- 引入 UnityGameFramework
- 使用 Luban 替代原来的 UGF 的数据表
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e1ba50f2aff7340b39fd7f9111b75d46
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class CombatReadinessForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private CombatReadinessView _view = null;
|
||||
|
||||
public CombatReadinessView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd24664add891420e8a896a74367b3e2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class CombatReadinessView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI squadMemberText;
|
||||
[SerializeField] public global::UnityEngine.RectTransform characterSlotRoot;
|
||||
[SerializeField] public global::SepCore.UI.CharacterSlotItem characterSlotTemplate;
|
||||
[SerializeField] public global::UnityEngine.UI.ToggleGroup difficultyTabsToggleGroup;
|
||||
[SerializeField] public global::TMPro.TMP_InputField seedInput;
|
||||
[SerializeField] public global::UnityEngine.UI.Button randomizeButton;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI partySizeText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI mapIdText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI timeLimitText;
|
||||
[SerializeField] public global::UnityEngine.UI.Button beginRunButton;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI storageText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e844a4c6c1b845babe155b335fd9931
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,187 @@
|
||||
//------------------------------------------------------------
|
||||
// Game Framework
|
||||
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
|
||||
// Homepage: https://gameframework.cn/
|
||||
// Feedback: mailto:ellan@gameframework.cn
|
||||
//------------------------------------------------------------
|
||||
|
||||
using GameFramework;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class DialogForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private TMP_Text _titleText = null;
|
||||
[SerializeField] private TMP_Text _messageText = null;
|
||||
[SerializeField] private GameObject[] _modeObjects = null;
|
||||
[SerializeField] private TMP_Text[] _confirmTexts = null;
|
||||
[SerializeField] private TMP_Text[] _cancelTexts = null;
|
||||
[SerializeField] private TMP_Text[] _otherTexts = null;
|
||||
|
||||
private int _dialogMode = 1;
|
||||
private bool _pauseGame = false;
|
||||
private object _userData = null;
|
||||
private GameFrameworkAction<object> _onClickConfirmGFAction = null;
|
||||
private GameFrameworkAction<object> _onClickCancelGFAction = null;
|
||||
private GameFrameworkAction<object> _onClickOtherGFAction = null;
|
||||
|
||||
public int DialogMode => _dialogMode;
|
||||
|
||||
public bool PauseGame => _pauseGame;
|
||||
|
||||
public object UserData => _userData;
|
||||
|
||||
public void OnConfirmButtonClick()
|
||||
{
|
||||
Close();
|
||||
|
||||
if (_onClickConfirmGFAction != null)
|
||||
{
|
||||
_onClickConfirmGFAction(_userData);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnCancelButtonClick()
|
||||
{
|
||||
Close();
|
||||
|
||||
if (_onClickCancelGFAction != null)
|
||||
{
|
||||
_onClickCancelGFAction(_userData);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnOtherButtonClick()
|
||||
{
|
||||
Close();
|
||||
|
||||
if (_onClickOtherGFAction != null)
|
||||
{
|
||||
_onClickOtherGFAction(_userData);
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_2017_3_OR_NEWER
|
||||
protected override void OnOpen(object userData)
|
||||
#else
|
||||
protected internal override void OnOpen(object userData)
|
||||
#endif
|
||||
{
|
||||
base.OnOpen(userData);
|
||||
|
||||
DialogParams dialogParams = (DialogParams)userData;
|
||||
if (dialogParams == null)
|
||||
{
|
||||
Log.Warning("DialogParams is invalid.");
|
||||
return;
|
||||
}
|
||||
|
||||
_dialogMode = dialogParams.Mode;
|
||||
RefreshDialogMode();
|
||||
|
||||
_titleText.text = dialogParams.Title;
|
||||
_messageText.text = dialogParams.Message;
|
||||
|
||||
_pauseGame = dialogParams.PauseGame;
|
||||
RefreshPauseGame();
|
||||
|
||||
_userData = dialogParams.UserData;
|
||||
|
||||
RefreshConfirmText(dialogParams.ConfirmText);
|
||||
_onClickConfirmGFAction = dialogParams.OnClickConfirm;
|
||||
|
||||
RefreshCancelText(dialogParams.CancelText);
|
||||
_onClickCancelGFAction = dialogParams.OnClickCancel;
|
||||
|
||||
RefreshOtherText(dialogParams.OtherText);
|
||||
_onClickOtherGFAction = dialogParams.OnClickOther;
|
||||
}
|
||||
|
||||
#if UNITY_2017_3_OR_NEWER
|
||||
protected override void OnClose(bool isShutdown, object userData)
|
||||
#else
|
||||
protected internal override void OnClose(bool isShutdown, object userData)
|
||||
#endif
|
||||
{
|
||||
if (_pauseGame)
|
||||
{
|
||||
GameEntry.Base.ResumeGame();
|
||||
}
|
||||
|
||||
_dialogMode = 1;
|
||||
_titleText.text = string.Empty;
|
||||
_messageText.text = string.Empty;
|
||||
_pauseGame = false;
|
||||
_userData = null;
|
||||
|
||||
RefreshConfirmText(string.Empty);
|
||||
_onClickConfirmGFAction = null;
|
||||
|
||||
RefreshCancelText(string.Empty);
|
||||
_onClickCancelGFAction = null;
|
||||
|
||||
RefreshOtherText(string.Empty);
|
||||
_onClickOtherGFAction = null;
|
||||
|
||||
base.OnClose(isShutdown, userData);
|
||||
}
|
||||
|
||||
private void RefreshDialogMode()
|
||||
{
|
||||
for (int i = 1; i <= _modeObjects.Length; i++)
|
||||
{
|
||||
_modeObjects[i - 1].SetActive(i == _dialogMode);
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshPauseGame()
|
||||
{
|
||||
if (_pauseGame)
|
||||
{
|
||||
GameEntry.Base.PauseGame();
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshConfirmText(string confirmText)
|
||||
{
|
||||
if (string.IsNullOrEmpty(confirmText))
|
||||
{
|
||||
confirmText = GameEntry.Localization.GetString("Dialog.ConfirmButton");
|
||||
}
|
||||
|
||||
for (int i = 0; i < _confirmTexts.Length; i++)
|
||||
{
|
||||
_confirmTexts[i].text = confirmText;
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshCancelText(string cancelText)
|
||||
{
|
||||
if (string.IsNullOrEmpty(cancelText))
|
||||
{
|
||||
cancelText = GameEntry.Localization.GetString("Dialog.CancelButton");
|
||||
}
|
||||
|
||||
for (int i = 0; i < _cancelTexts.Length; i++)
|
||||
{
|
||||
_cancelTexts[i].text = cancelText;
|
||||
}
|
||||
}
|
||||
|
||||
private void RefreshOtherText(string otherText)
|
||||
{
|
||||
if (string.IsNullOrEmpty(otherText))
|
||||
{
|
||||
otherText = GameEntry.Localization.GetString("Dialog.OtherButton");
|
||||
}
|
||||
|
||||
for (int i = 0; i < _otherTexts.Length; i++)
|
||||
{
|
||||
_otherTexts[i].text = otherText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c04f3be6bab0c7748bc236f9023e47f9
|
||||
timeCreated: 1528026160
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 036d06d6cc25544ea90bd46de5974c01
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class InventoryForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private InventoryView _view = null;
|
||||
|
||||
public InventoryView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b868ef78fbd6c4123b62dc81031ed579
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class InventoryView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::TMPro.TMP_InputField searchInput;
|
||||
[SerializeField] public global::UnityEngine.UI.Button sortButton;
|
||||
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
|
||||
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
|
||||
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 21f832ef1e5da4b37b7754cca1ebf511
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9618a0e69480c40b383585e41cda54a1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class InventoryPanelForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private InventoryPanelView _view = null;
|
||||
|
||||
public InventoryPanelView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bffe339530c484a4b83162e20f163ed8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class InventoryPanelView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.UI.InputField searchInput;
|
||||
[SerializeField] public global::UnityEngine.UI.Button sortButton;
|
||||
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
|
||||
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
|
||||
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
|
||||
[SerializeField] public global::UnityEngine.UI.Text itemCountText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f585fae70a14d446ba433f3244efded1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d1792508be4541c49721d77aaa16dce
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class CharacterSlotItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Image bg;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private TextMeshProUGUI characterName;
|
||||
[SerializeField] private TextMeshProUGUI hpText;
|
||||
[SerializeField] private TextMeshProUGUI mpText;
|
||||
[SerializeField] private TextMeshProUGUI speedText;
|
||||
[SerializeField] private TextMeshProUGUI atkText;
|
||||
[SerializeField] private TextMeshProUGUI matText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2d3418d26a66340028b5d353f0077c1c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class WarehouseSlotItem : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Image bg;
|
||||
[SerializeField] private Button button;
|
||||
[SerializeField] private Image icon;
|
||||
[SerializeField] private Image rarity;
|
||||
[SerializeField] private TextMeshProUGUI quantityText;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ec7b73a5570746109f8d90e913c60fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f11d28eb127c848f9a125ff5bcd2a1de
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class ItemDetailsForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private ItemDetailsView _view = null;
|
||||
|
||||
public ItemDetailsView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e09bdcb7cd0e7496a99a97c757443573
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class ItemDetailsView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.UI.Image itemDetailIcon;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailNameText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailTypeText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI hpText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI atkText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI mpText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI matText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI speedText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI stackText;
|
||||
[SerializeField] public global::TMPro.TextMeshProUGUI itemDetailDescriptionText;
|
||||
[SerializeField] public global::UnityEngine.UI.Button openLoadoutButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74cd58111cada45899baca93e46a0ad8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ceade84509cfa498a91c9a2fe55cc189
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class ItemDetailsPanelForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private ItemDetailsPanelView _view = null;
|
||||
|
||||
public ItemDetailsPanelView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ba271361c636f48edb5d7d8ba15a595c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class ItemDetailsPanelView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.UI.Image itemDetailIcon;
|
||||
[SerializeField] public global::UnityEngine.UI.Text nameText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text typeText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text hpText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text atkText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text mpText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text matText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text speedText;
|
||||
[SerializeField] public global::UnityEngine.UI.Text stackText;
|
||||
[SerializeField] public global::UnityEngine.UI.Button openLoadoutButton;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4774c8ef6d24f489c8c5858aa014ff13
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f7427e99cf1bf49f7b82612190590a69
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class LobbyForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private LobbyView _view = null;
|
||||
|
||||
public LobbyView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 650697aa51fa44ca9881dcc2e564d35b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class LobbyView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.UI.Button homeButton;
|
||||
[SerializeField] public global::UnityEngine.RectTransform selectionMarkerObject;
|
||||
[SerializeField] public global::UnityEngine.UI.Button warehouseButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button loadoutButton;
|
||||
[SerializeField] public global::SepCore.UI.WarehouseView warehouseView;
|
||||
[SerializeField] public global::SepCore.UI.CombatReadinessView combatRandinessView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d9bc156ee806453a8f2ddd99b1dab0c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 233579b69c85c4f9db143fcf0368c36a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class MainWarehouseForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private MainWarehouseView _view = null;
|
||||
|
||||
public MainWarehouseView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca70f33fa4f2c4a989b89f280e24201a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class MainWarehouseView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::UnityEngine.UI.Button homeButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button warehouseButton;
|
||||
[SerializeField] public global::UnityEngine.UI.Button loadoutButton;
|
||||
[SerializeField] public global::UnityEngine.UI.InputField searchInput;
|
||||
[SerializeField] public global::UnityEngine.UI.Button sortButton;
|
||||
[SerializeField] public global::UnityEngine.UI.ScrollRect itemScroll;
|
||||
[SerializeField] public global::UnityEngine.RectTransform warehouseSlotRoot;
|
||||
[SerializeField] public global::SepCore.UI.WarehouseSlotItem warehouseSlotTemplate;
|
||||
[SerializeField] public global::UnityEngine.UI.Text itemCountText;
|
||||
[SerializeField] public global::SepCore.UI.ItemDetailsView itemDetailsView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f169da115e10a47e4b0b3bfefaff0d71
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "SepCore.Presentation",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:a04b272484018094ab427253f20c416c",
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:11ec41dbc3557e6499b2845ba531a9b0",
|
||||
"GUID:363c5eb08ff8e6a439b85e37b8c20d96",
|
||||
"GUID:f51ebe6a0ceec4240a699833d6309b23",
|
||||
"GUID:d54b9488b03814a44ab937f0aeb738b1"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 73a59a40d41e9ce48b3e0515aeec4217
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7dd243b8051ec4d7596ba47b4a079669
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[ExecuteAlways]
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class UISerializationItem : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class ComponentReference
|
||||
{
|
||||
[SerializeField] private Component component;
|
||||
[SerializeField] private bool generateReference;
|
||||
[SerializeField] private string variableName;
|
||||
|
||||
public Component Component => component;
|
||||
public bool GenerateReference => generateReference;
|
||||
public string VariableName => variableName;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
internal ComponentReference(Component target, string defaultVariableName)
|
||||
{
|
||||
component = target;
|
||||
generateReference = false;
|
||||
variableName = defaultVariableName;
|
||||
}
|
||||
|
||||
internal void Configure(bool shouldGenerate, string generatedVariableName)
|
||||
{
|
||||
generateReference = shouldGenerate;
|
||||
variableName = generatedVariableName;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
[SerializeField, HideInInspector]
|
||||
private List<ComponentReference> componentReferences = new List<ComponentReference>();
|
||||
|
||||
public IReadOnlyList<ComponentReference> ComponentReferences => componentReferences;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private bool refreshQueued;
|
||||
|
||||
public bool RefreshComponents()
|
||||
{
|
||||
Component[] attachedComponents = GetComponents<Component>();
|
||||
var next = new List<ComponentReference>(attachedComponents.Length);
|
||||
|
||||
for (int i = 0; i < attachedComponents.Length; i++)
|
||||
{
|
||||
Component attached = attachedComponents[i];
|
||||
if (attached == null || attached == this || attached is UISerializationRoot)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ComponentReference existing = FindReference(attached);
|
||||
next.Add(existing ?? new ComponentReference(attached, CreateDefaultVariableName(gameObject, attached)));
|
||||
}
|
||||
|
||||
if (HasSameComponents(next))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
componentReferences = next;
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetReference(Component component, bool shouldGenerate, string variableName)
|
||||
{
|
||||
if (component == null || component.gameObject != gameObject)
|
||||
{
|
||||
throw new ArgumentException("The component must be attached to the same GameObject as the serialization item.", nameof(component));
|
||||
}
|
||||
|
||||
RefreshComponents();
|
||||
ComponentReference reference = FindReference(component);
|
||||
if (reference == null)
|
||||
{
|
||||
throw new InvalidOperationException("The component is not available for UI serialization.");
|
||||
}
|
||||
|
||||
string normalizedName = variableName == null ? string.Empty : variableName.Trim();
|
||||
if (reference.GenerateReference == shouldGenerate && reference.VariableName == normalizedName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
reference.Configure(shouldGenerate, normalizedName);
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
NotifyRoot();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string CreateDefaultVariableName(GameObject owner, Component component)
|
||||
{
|
||||
string ownerName = ToCamelIdentifier(owner == null ? "uiItem" : owner.name);
|
||||
string typeName = component == null ? "Component" : component.GetType().Name;
|
||||
|
||||
if (component is RectTransform)
|
||||
{
|
||||
typeName = "RectTransform";
|
||||
}
|
||||
|
||||
if (ownerName.EndsWith(typeName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return ownerName;
|
||||
}
|
||||
|
||||
return ownerName + typeName;
|
||||
}
|
||||
|
||||
internal void QueueRefresh()
|
||||
{
|
||||
if (refreshQueued || Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
refreshQueued = true;
|
||||
UnityEditor.EditorApplication.delayCall += RefreshDelayed;
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
RefreshComponents();
|
||||
NotifyRoot();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
QueueRefresh();
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
QueueRefresh();
|
||||
}
|
||||
|
||||
private void RefreshDelayed()
|
||||
{
|
||||
refreshQueued = false;
|
||||
if (this == null || Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshComponents();
|
||||
NotifyRoot();
|
||||
}
|
||||
|
||||
private void NotifyRoot()
|
||||
{
|
||||
UISerializationRoot root = GetComponentInParent<UISerializationRoot>(true);
|
||||
if (root != null)
|
||||
{
|
||||
root.QueueRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
private ComponentReference FindReference(Component component)
|
||||
{
|
||||
for (int i = 0; i < componentReferences.Count; i++)
|
||||
{
|
||||
ComponentReference reference = componentReferences[i];
|
||||
if (reference != null && reference.Component == component)
|
||||
{
|
||||
return reference;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private bool HasSameComponents(List<ComponentReference> next)
|
||||
{
|
||||
if (componentReferences.Count != next.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < next.Count; i++)
|
||||
{
|
||||
if (componentReferences[i] == null || componentReferences[i].Component != next[i].Component)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static string ToCamelIdentifier(string value)
|
||||
{
|
||||
var builder = new StringBuilder(value.Length + 8);
|
||||
bool capitalizeNext = false;
|
||||
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
char current = value[i];
|
||||
if (!char.IsLetterOrDigit(current) && current != '_')
|
||||
{
|
||||
capitalizeNext = builder.Length > 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (builder.Length == 0)
|
||||
{
|
||||
if (char.IsDigit(current))
|
||||
{
|
||||
builder.Append('_');
|
||||
}
|
||||
builder.Append(char.ToLowerInvariant(current));
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.Append(capitalizeNext ? char.ToUpperInvariant(current) : current);
|
||||
capitalizeNext = false;
|
||||
}
|
||||
|
||||
return builder.Length == 0 ? "uiItem" : builder.ToString();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fbaa237e23f7d4d3f85f73e0acd7eaec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,312 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[ExecuteAlways]
|
||||
[DisallowMultipleComponent]
|
||||
public sealed class UISerializationRoot : MonoBehaviour
|
||||
{
|
||||
[Serializable]
|
||||
public sealed class NestedViewReference
|
||||
{
|
||||
[SerializeField] private UISerializationRoot root;
|
||||
[SerializeField] private bool generateReference;
|
||||
[SerializeField] private string variableName;
|
||||
|
||||
public UISerializationRoot Root => root;
|
||||
public bool GenerateReference => generateReference;
|
||||
public string VariableName => variableName;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
internal NestedViewReference(UISerializationRoot nestedRoot, string defaultVariableName)
|
||||
{
|
||||
root = nestedRoot;
|
||||
generateReference = true;
|
||||
variableName = defaultVariableName;
|
||||
}
|
||||
|
||||
internal void Configure(bool shouldGenerate, string generatedVariableName)
|
||||
{
|
||||
generateReference = shouldGenerate;
|
||||
variableName = generatedVariableName;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
[SerializeField, HideInInspector]
|
||||
private List<UISerializationItem> serializationItems = new List<UISerializationItem>();
|
||||
|
||||
[SerializeField, HideInInspector]
|
||||
private List<NestedViewReference> nestedViewReferences = new List<NestedViewReference>();
|
||||
|
||||
public IReadOnlyList<UISerializationItem> SerializationItems => serializationItems;
|
||||
public IReadOnlyList<NestedViewReference> NestedViewReferences => nestedViewReferences;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private bool refreshQueued;
|
||||
|
||||
public bool RefreshItems()
|
||||
{
|
||||
UISerializationItem[] allItems = GetComponentsInChildren<UISerializationItem>(true);
|
||||
var ownedItems = new List<UISerializationItem>(allItems.Length);
|
||||
for (int i = 0; i < allItems.Length; i++)
|
||||
{
|
||||
UISerializationItem item = allItems[i];
|
||||
if (item == null || FindNearestRoot(item.transform) != this)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
item.RefreshComponents();
|
||||
ownedItems.Add(item);
|
||||
}
|
||||
|
||||
UISerializationRoot[] allRoots = GetComponentsInChildren<UISerializationRoot>(true);
|
||||
var directNestedRoots = new List<UISerializationRoot>(allRoots.Length);
|
||||
for (int i = 0; i < allRoots.Length; i++)
|
||||
{
|
||||
UISerializationRoot candidate = allRoots[i];
|
||||
if (candidate != null && candidate != this && FindNearestParentRoot(candidate.transform) == this)
|
||||
{
|
||||
directNestedRoots.Add(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
bool itemsChanged = !HasSameItems(ownedItems);
|
||||
bool nestedViewsChanged = !HasSameNestedViews(directNestedRoots);
|
||||
if (!itemsChanged && !nestedViewsChanged)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (itemsChanged)
|
||||
{
|
||||
serializationItems.Clear();
|
||||
serializationItems.AddRange(ownedItems);
|
||||
}
|
||||
|
||||
if (nestedViewsChanged)
|
||||
{
|
||||
var next = new List<NestedViewReference>(directNestedRoots.Count);
|
||||
for (int i = 0; i < directNestedRoots.Count; i++)
|
||||
{
|
||||
UISerializationRoot nestedRoot = directNestedRoots[i];
|
||||
NestedViewReference existing = FindNestedView(nestedRoot);
|
||||
next.Add(existing ?? new NestedViewReference(nestedRoot, CreateDefaultNestedViewVariableName(nestedRoot)));
|
||||
}
|
||||
|
||||
nestedViewReferences = next;
|
||||
}
|
||||
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetNestedViewReference(UISerializationRoot nestedRoot, bool shouldGenerate, string variableName)
|
||||
{
|
||||
if (nestedRoot == null || FindNearestParentRoot(nestedRoot.transform) != this)
|
||||
{
|
||||
throw new ArgumentException("The nested root must be directly owned by this serialization root.", nameof(nestedRoot));
|
||||
}
|
||||
|
||||
RefreshItems();
|
||||
NestedViewReference reference = FindNestedView(nestedRoot);
|
||||
if (reference == null)
|
||||
{
|
||||
throw new InvalidOperationException("The nested root is not registered.");
|
||||
}
|
||||
|
||||
string normalizedName = variableName == null ? string.Empty : variableName.Trim();
|
||||
if (reference.GenerateReference == shouldGenerate && reference.VariableName == normalizedName)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
reference.Configure(shouldGenerate, normalizedName);
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string CreateDefaultNestedViewVariableName(UISerializationRoot nestedRoot)
|
||||
{
|
||||
string sourceName = nestedRoot == null ? "nested" : nestedRoot.gameObject.name.Replace("(Clone)", string.Empty).Trim();
|
||||
if (sourceName.EndsWith("Form", StringComparison.Ordinal) && sourceName.Length > 4)
|
||||
{
|
||||
sourceName = sourceName.Substring(0, sourceName.Length - 4);
|
||||
}
|
||||
else if (sourceName.EndsWith("UI", StringComparison.Ordinal) && sourceName.Length > 2)
|
||||
{
|
||||
sourceName = sourceName.Substring(0, sourceName.Length - 2);
|
||||
}
|
||||
|
||||
string identifier = ToPascalIdentifier(sourceName);
|
||||
if (string.IsNullOrEmpty(identifier))
|
||||
{
|
||||
identifier = "Nested";
|
||||
}
|
||||
|
||||
return char.ToLowerInvariant(identifier[0]) + identifier.Substring(1) + "View";
|
||||
}
|
||||
|
||||
internal void QueueRefresh()
|
||||
{
|
||||
if (refreshQueued || Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
refreshQueued = true;
|
||||
UnityEditor.EditorApplication.delayCall += RefreshDelayed;
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
RefreshItems();
|
||||
NotifyParentRoot();
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
QueueRefresh();
|
||||
NotifyParentRoot();
|
||||
}
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
QueueRefresh();
|
||||
NotifyParentRoot();
|
||||
}
|
||||
|
||||
private void OnTransformChildrenChanged()
|
||||
{
|
||||
QueueRefresh();
|
||||
}
|
||||
|
||||
private void OnTransformParentChanged()
|
||||
{
|
||||
QueueRefresh();
|
||||
NotifyParentRoot();
|
||||
}
|
||||
|
||||
private void RefreshDelayed()
|
||||
{
|
||||
refreshQueued = false;
|
||||
if (this == null || Application.isPlaying)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RefreshItems();
|
||||
}
|
||||
|
||||
private bool HasSameItems(List<UISerializationItem> found)
|
||||
{
|
||||
if (serializationItems.Count != found.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < found.Count; i++)
|
||||
{
|
||||
if (serializationItems[i] != found[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool HasSameNestedViews(List<UISerializationRoot> found)
|
||||
{
|
||||
if (nestedViewReferences.Count != found.Count)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < found.Count; i++)
|
||||
{
|
||||
if (nestedViewReferences[i] == null || nestedViewReferences[i].Root != found[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private NestedViewReference FindNestedView(UISerializationRoot nestedRoot)
|
||||
{
|
||||
for (int i = 0; i < nestedViewReferences.Count; i++)
|
||||
{
|
||||
NestedViewReference reference = nestedViewReferences[i];
|
||||
if (reference != null && reference.Root == nestedRoot)
|
||||
{
|
||||
return reference;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void NotifyParentRoot()
|
||||
{
|
||||
UISerializationRoot parentRoot = FindNearestParentRoot(transform);
|
||||
if (parentRoot != null)
|
||||
{
|
||||
parentRoot.QueueRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
private static UISerializationRoot FindNearestRoot(Transform target)
|
||||
{
|
||||
Transform current = target;
|
||||
while (current != null)
|
||||
{
|
||||
UISerializationRoot root = current.GetComponent<UISerializationRoot>();
|
||||
if (root != null)
|
||||
{
|
||||
return root;
|
||||
}
|
||||
|
||||
current = current.parent;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static UISerializationRoot FindNearestParentRoot(Transform target)
|
||||
{
|
||||
return target == null ? null : FindNearestRoot(target.parent);
|
||||
}
|
||||
|
||||
private static string ToPascalIdentifier(string value)
|
||||
{
|
||||
var builder = new StringBuilder(value.Length + 8);
|
||||
bool capitalizeNext = true;
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
char current = value[i];
|
||||
if (!char.IsLetterOrDigit(current) && current != '_')
|
||||
{
|
||||
capitalizeNext = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (builder.Length == 0 && char.IsDigit(current))
|
||||
{
|
||||
builder.Append('_');
|
||||
}
|
||||
|
||||
builder.Append(capitalizeNext ? char.ToUpperInvariant(current) : current);
|
||||
capitalizeNext = false;
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 335062b0d81ae40f49c923ef4bf19dd7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class UpdateResourceForm : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private Text m_DescriptionText = null;
|
||||
|
||||
[SerializeField]
|
||||
private Slider m_ProgressSlider = null;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void SetProgress(float progress, string description)
|
||||
{
|
||||
m_ProgressSlider.value = progress;
|
||||
m_DescriptionText.text = description;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d8946ea9933b16499cd11174ad3c410
|
||||
timeCreated: 1504077253
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0617c7a71b4ca45ba97d5960139c4038
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class WarehouseForm : UGuiForm
|
||||
{
|
||||
[SerializeField] private WarehouseView _view = null;
|
||||
|
||||
public WarehouseView View => _view;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6640dcc788ca49ac88b63f5ca39163a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,12 @@
|
||||
// <auto-generated />
|
||||
using UnityEngine;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public partial class WarehouseView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public global::SepCore.UI.InventoryView inventoryPanelView;
|
||||
[SerializeField] public global::SepCore.UI.ItemDetailsView itemDetailsPanelView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b37653f27a37b493691e4a8347d826e8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user