BS 0.2.0 UI控件同步 / EP Unity.1 Diagram版本下的附属增强提案
This commit is contained in:
@@ -15,11 +15,6 @@ namespace Convention.WindowsUI.Variant
|
||||
[Resources, OnlyNotNullMode, SerializeField, Tooltip("Path Text")] private Text m_PathTitle;
|
||||
[Content, OnlyPlayMode] public string CurrentTargetName;
|
||||
[Content, OnlyPlayMode, SerializeField] public List<string> pathContainer = new();
|
||||
private RegisterWrapper<AssetsWindow> m_RegisterWrapper;
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_RegisterWrapper.Release();
|
||||
}
|
||||
|
||||
public PropertiesWindow MainPropertiesWindow => m_PropertiesWindow;
|
||||
|
||||
@@ -33,12 +28,11 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
m_BackButton.onClick.AddListener(() => Pop(true));
|
||||
UpdatePathText();
|
||||
m_RegisterWrapper = new(() => { });
|
||||
Architecture.RegisterWithDuplicateAllow(typeof(AssetsWindow), this, () => { });
|
||||
}
|
||||
|
||||
protected virtual void Reset()
|
||||
{
|
||||
m_PropertiesWindow.m_PerformanceMode = PerformanceIndicator.PerformanceMode.L1;
|
||||
m_PropertiesWindow = GetComponent<PropertiesWindow>();
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ namespace Convention.WindowsUI.Variant
|
||||
public static void InitLoadedRoots(ref List<string> LoadedInRoot)
|
||||
{
|
||||
LoadedInRoot = new List<string>();
|
||||
if (PlatformIndicator.is_platform_windows)
|
||||
if (PlatformIndicator.IsPlatformWindows)
|
||||
{
|
||||
LoadedInRoot.Add(Application.persistentDataPath);
|
||||
LoadedInRoot.Add(Application.streamingAssetsPath);
|
||||
|
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
public class FileSystemAssetsItem : MonoAnyBehaviour, AssetsItem.IAssetsItemInvoke
|
||||
public class FileSystemAssetsItem : MonoBehaviour, AssetsItem.IAssetsItemInvoke
|
||||
{
|
||||
public static Dictionary<string, ToolFile> LoadedFiles = new();
|
||||
public static long LoadedFileAutoLoadMaxFileSize = 1024 * 50;
|
||||
@@ -18,15 +18,6 @@ namespace Convention.WindowsUI.Variant
|
||||
[Content, OnlyNotNullMode, SerializeField, InspectorDraw(InspectorDrawType.Toggle), Ignore]
|
||||
private bool m_IsLoading = false;
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (m_File.data is AssetBundle)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_File.data = null;
|
||||
}
|
||||
|
||||
public void RebuildFileInfo([In] string path)
|
||||
{
|
||||
if (LoadedFiles.ContainsKey(path))
|
||||
@@ -67,15 +58,15 @@ namespace Convention.WindowsUI.Variant
|
||||
private void OnAssetsItemFocusWithFileMode([In] AssetsItem item, [In] string name)
|
||||
{
|
||||
item.title = name;
|
||||
FileSystemAssets.instance.CurrentSelectFilename.title = m_File.FullPath;
|
||||
if (m_File.IsExist == false)
|
||||
FileSystemAssets.instance.CurrentSelectFilename.title = m_File.GetFullPath();
|
||||
if (m_File.Exists() == false)
|
||||
return;
|
||||
else if (m_File.IsDir())
|
||||
UpdateSprite(item, "folder");
|
||||
else if (m_File.Extension.Length != 0 && m_Icons.uobjects.ContainsKey(m_File.Extension))
|
||||
UpdateSprite(item, m_File.Extension);
|
||||
else if (m_File.Extension.Length != 0 && m_Icons.uobjects.ContainsKey(m_File.Extension[1..]))
|
||||
UpdateSprite(item, m_File.Extension[1..]);
|
||||
else if (m_File.GetExtension().Length != 0 && m_Icons.uobjects.ContainsKey(m_File.GetExtension()))
|
||||
UpdateSprite(item, m_File.GetExtension());
|
||||
else if (m_File.GetExtension().Length != 0 && m_Icons.uobjects.ContainsKey(m_File.GetExtension()[1..]))
|
||||
UpdateSprite(item, m_File.GetExtension()[1..]);
|
||||
else if (m_File.IsImage)
|
||||
UpdateSprite(item, "image");
|
||||
else if (m_File.IsText)
|
||||
@@ -101,8 +92,9 @@ namespace Convention.WindowsUI.Variant
|
||||
private class SkyItem : AssetBundleItem
|
||||
{
|
||||
[Resources, SerializeField] private Material SkyBox;
|
||||
public class SkyItemInstanceWrapper : Singleton<SkyItemInstanceWrapper>
|
||||
public class SkyItemInstanceWrapper
|
||||
{
|
||||
public static SkyItemInstanceWrapper instance { get; protected set; }
|
||||
public static void InitInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
|
@@ -9,7 +9,6 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
[Resources, OnlyNotNullMode] public WindowManager m_WindowManager;
|
||||
[Resources, SerializeField, OnlyNotNullMode] private PropertiesWindow m_PropertiesWindow;
|
||||
private RegisterWrapper<ConversationWindow> m_RegisterWrapper;
|
||||
|
||||
[Resources, Header("HeadLine"), OnlyNotNullMode] public Image HeadIcon;
|
||||
[Resources, OnlyNotNullMode] public ModernUIInputField HeadText = new();
|
||||
@@ -36,15 +35,11 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_RegisterWrapper = new(() =>
|
||||
Architecture.RegisterWithDuplicateAllow(typeof(ConversationWindow), this, () =>
|
||||
{
|
||||
|
||||
});
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_RegisterWrapper.Release();
|
||||
}
|
||||
|
||||
public void SetHeadText(string text)
|
||||
{
|
||||
|
@@ -7,11 +7,11 @@ namespace Convention
|
||||
{
|
||||
public interface ILoadedInHierarchy { }
|
||||
public interface IOnlyLoadedInHierarchy { }
|
||||
public class HierarchyLoadedIn : MonoAnyBehaviour
|
||||
public class HierarchyLoadedIn : MonoBehaviour
|
||||
{
|
||||
private void Update()
|
||||
{
|
||||
if (!RegisterBaseWrapperExtension.Registers.ContainsKey(typeof(WindowsUI.Variant.HierarchyWindow)))
|
||||
if (!Architecture.Contains<WindowsUI.Variant.HierarchyWindow>())
|
||||
return;
|
||||
var onlys = GetComponents<IOnlyLoadedInHierarchy>();
|
||||
try
|
||||
|
@@ -9,14 +9,13 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
[Resources] public WindowManager windowManager;
|
||||
[Resources, SerializeField] private PropertiesWindow m_PropertiesWindow;
|
||||
private RegisterWrapper<HierarchyWindow> m_RegisterWrapper;
|
||||
|
||||
private Dictionary<int, object> AllReferenceLinker = new();
|
||||
private Dictionary<object, int> AllReferenceLinker_R = new();
|
||||
private Dictionary<object, HierarchyItem> AllReferenceItemLinker = new();
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><EFBFBD>tab
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ӧ<EFBFBD><D3A6>tab
|
||||
/// </summary>
|
||||
/// <param name="reference"></param>
|
||||
/// <param name="item"></param>
|
||||
@@ -97,7 +96,7 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
private void Start()
|
||||
{
|
||||
m_RegisterWrapper = new(() => { });
|
||||
Architecture.RegisterWithDuplicateAllow(typeof(HierarchyWindow), this, () => { });
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
@@ -106,10 +105,6 @@ namespace Convention.WindowsUI.Variant
|
||||
m_PropertiesWindow = GetComponent<PropertiesWindow>();
|
||||
AllReferenceLinker = new();
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_RegisterWrapper.Release();
|
||||
}
|
||||
|
||||
public void RenameTabWhenItFocus()
|
||||
{
|
||||
|
@@ -37,7 +37,7 @@ namespace Convention.WindowsUI.Variant
|
||||
if (path == null || path.Length == 0)
|
||||
return;
|
||||
var file = new ToolFile(path);
|
||||
if (file.IsExist == false)
|
||||
if (file.Exists() == false)
|
||||
return;
|
||||
Texture2D texture = file.LoadAsImage();
|
||||
SetImage(texture);
|
||||
|
@@ -8,7 +8,7 @@ using static Convention.WindowsUI.Variant.PropertiesWindow;
|
||||
namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
/// <summary>
|
||||
/// enum&1==1<><31>Ϊ<EFBFBD><CEAA>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// enum&1==1<><31>Ϊ<EFBFBD><CEAA>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
public enum InspectorDrawType
|
||||
{
|
||||
@@ -400,9 +400,8 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>, <20><><EFBFBD><EFBFBD>GameObject<63><74>SetTarget<65><74>Inspector<6F><72>ʱֻչʾ<D5B9><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>չʾComponentsҲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><To GameObject><3E><>ת<EFBFBD><D7AA>GameObject<63><74>Components<74>б<EFBFBD>,
|
||||
/// <20><><see cref="InspectorWindow.BuildWindow"/>
|
||||
///
|
||||
/// <see cref="InspectorWindow.BuildWindow"/>
|
||||
/// </summary>
|
||||
public interface IOnlyFocusThisOnInspector : IAnyClass { }
|
||||
public interface IOnlyFocusThisOnInspector { }
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
[Resources] public ModernUIInputField TextArea;
|
||||
[Resources] public Button RawButton;
|
||||
public IAnyClass lastReference;
|
||||
public object lastReference;
|
||||
[Content] public bool isEditing = false;
|
||||
|
||||
private void OnCallback(string str)
|
||||
|
@@ -7,10 +7,9 @@ using UnityEngine;
|
||||
|
||||
namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
public class InspectorWindow : WindowsComponent, ISingleton<InspectorWindow>
|
||||
public class InspectorWindow : WindowsComponent
|
||||
{
|
||||
public static InspectorWindow instance { get; private set; }
|
||||
private RegisterWrapper<InspectorWindow> m_RegisterWrapper;
|
||||
private object target;
|
||||
|
||||
[Setting] public bool IsWorkWithHierarchyWindow = true;
|
||||
@@ -32,11 +31,6 @@ namespace Convention.WindowsUI.Variant
|
||||
m_PropertiesWindow = GetComponent<PropertiesWindow>();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
m_RegisterWrapper.Release();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (m_WindowManager == null)
|
||||
@@ -44,7 +38,7 @@ namespace Convention.WindowsUI.Variant
|
||||
if (m_PropertiesWindow == null)
|
||||
m_PropertiesWindow = GetComponent<PropertiesWindow>();
|
||||
|
||||
m_RegisterWrapper = new(() => { });
|
||||
Architecture.RegisterWithDuplicateAllow(typeof(InspectorWindow), this, () => { });
|
||||
instance = this;
|
||||
|
||||
if (IsWorkWithHierarchyWindow == true)
|
||||
@@ -91,12 +85,12 @@ namespace Convention.WindowsUI.Variant
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ӧ<EFBFBD><D3A6>tab
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD>Ӧ<EFBFBD><D3A6>tab
|
||||
/// </summary>
|
||||
/// <param name="target"></param>
|
||||
/// <param name="item"></param>
|
||||
/// <returns><3E>Ƿ<EFBFBD><C7B7>봫<EFBFBD><EBB4AB><EFBFBD><EFBFBD>target<EFBFBD><EFBFBD>ͬ</returns>
|
||||
[return: When("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>target<EFBFBD>뱻<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊtarget<EFBFBD><EFBFBD>ʵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬ")]
|
||||
/// <returns><3E>Ƿ<EFBFBD><C7B7>봫<EFBFBD><EBB4AB><EFBFBD>target<65><74>ͬ</returns>
|
||||
[return: When("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>target<65>뱻<EFBFBD><EBB1BB><EFBFBD><EFBFBD>Ϊtarget<65><74>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>ͬ")]
|
||||
public bool SetTarget([In] object target, [In, Opt] HierarchyItem item)
|
||||
{
|
||||
if (item != null && IsWorkWithHierarchyWindow)
|
||||
@@ -159,7 +153,6 @@ namespace Convention.WindowsUI.Variant
|
||||
m_currentEntries.Clear();
|
||||
}
|
||||
private static readonly Type[] IgnoreCutOffType = new Type[] {
|
||||
typeof(MonoAnyBehaviour),
|
||||
typeof(GameObject),
|
||||
typeof(MonoBehaviour),
|
||||
typeof(UnityEngine.Object),
|
||||
|
@@ -7,11 +7,13 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Convention.WindowsUI.Variant
|
||||
{
|
||||
public class PropertiesWindow : MonoAnyBehaviour
|
||||
public class PropertiesWindow : MonoBehaviour
|
||||
{
|
||||
[ArgPackage]
|
||||
public class ItemEntry : LeftValueReference<WindowUIModule>
|
||||
public class ItemEntry
|
||||
{
|
||||
private WindowUIModule m_module;
|
||||
|
||||
#region Tools
|
||||
|
||||
private static bool IsSetupParentRectTransformAdjustSizeToContainsChilds = false;
|
||||
@@ -118,8 +120,8 @@ namespace Convention.WindowsUI.Variant
|
||||
public static IActionInvoke MakeItemAsActionInvoke(
|
||||
[In, Out] ItemEntry entry,
|
||||
[In] string invokerName, [In] PropertiesWindow parent,
|
||||
[In][Opt, When("If you sure not need a target")] IAnyClass target,
|
||||
params UnityAction<IAnyClass>[] actions)
|
||||
[In][Opt, When("If you sure not need a target")] object target,
|
||||
params UnityAction<object>[] actions)
|
||||
{
|
||||
entry.ref_value = InstantiateItemObject(invokerName, parent.m_WindowManager, parent.m_WindowsConfig);
|
||||
var invoker = entry.ref_value as IActionInvoke;
|
||||
@@ -132,8 +134,8 @@ namespace Convention.WindowsUI.Variant
|
||||
public static IButton MakeItemAsActionInvoke(
|
||||
[In, Out] ItemEntry entry,
|
||||
[In] string invokerName, [In] ItemEntry parent, [In] SO.Windows config,
|
||||
[In][Opt, When("If you sure not need a target")] IAnyClass target,
|
||||
params UnityAction<IAnyClass>[] actions)
|
||||
[In][Opt, When("If you sure not need a target")] object target,
|
||||
params UnityAction<object>[] actions)
|
||||
{
|
||||
entry.ref_value = InstantiateItemObject(invokerName, parent.ref_value.GetComponent<RectTransform>(), config);
|
||||
var invoker = entry.ref_value as IButton;
|
||||
@@ -147,8 +149,8 @@ namespace Convention.WindowsUI.Variant
|
||||
public static IButton MakeItemAsButton(
|
||||
[In, Out] ItemEntry entry,
|
||||
[In] string buttonName, [In] PropertiesWindow parent,
|
||||
[In][Opt, When("If you sure not need a target")] IAnyClass target,
|
||||
params UnityAction<IAnyClass>[] actions)
|
||||
[In][Opt, When("If you sure not need a target")] object target,
|
||||
params UnityAction<object>[] actions)
|
||||
{
|
||||
entry.ref_value = InstantiateItemObject(buttonName, parent.m_WindowManager, parent.m_WindowsConfig);
|
||||
var button = entry.ref_value as IButton;
|
||||
@@ -161,8 +163,8 @@ namespace Convention.WindowsUI.Variant
|
||||
public static IButton MakeItemAsButton(
|
||||
[In, Out] ItemEntry entry,
|
||||
[In] string buttonName, [In] ItemEntry parent, [In] SO.Windows config,
|
||||
[In][Opt, When("If you sure not need a target")] IAnyClass target,
|
||||
params UnityAction<IAnyClass>[] actions)
|
||||
[In][Opt, When("If you sure not need a target")] object target,
|
||||
params UnityAction<object>[] actions)
|
||||
{
|
||||
entry.ref_value = InstantiateItemObject(buttonName, parent.ref_value.GetComponent<RectTransform>(), config);
|
||||
var button = entry.ref_value as IButton;
|
||||
@@ -219,18 +221,18 @@ namespace Convention.WindowsUI.Variant
|
||||
|
||||
#endregion
|
||||
|
||||
public override WindowUIModule ref_value
|
||||
public WindowUIModule ref_value
|
||||
{
|
||||
get => base.ref_value;
|
||||
get => m_module;
|
||||
set
|
||||
{
|
||||
if (base.ref_value != value)
|
||||
if (m_module != value)
|
||||
{
|
||||
if (base.ref_value != null)
|
||||
if (m_module != null)
|
||||
{
|
||||
base.ref_value.gameObject.SetActive(false);
|
||||
m_module.gameObject.SetActive(false);
|
||||
}
|
||||
base.ref_value = value;
|
||||
m_module = value;
|
||||
if (parentWindow != null)
|
||||
{
|
||||
parentWindow.m_WindowManager.SelectContextPlane(parentWindow.m_TargetWindowContent);
|
||||
@@ -266,7 +268,7 @@ namespace Convention.WindowsUI.Variant
|
||||
public List<ItemEntry> GetChilds() => new(childs);
|
||||
public ItemEntry GetParent() => parentEntry;
|
||||
|
||||
public ItemEntry(PropertiesWindow parent) : base(null)
|
||||
public ItemEntry(PropertiesWindow parent)
|
||||
{
|
||||
childs = new();
|
||||
this.parentWindow = parent;
|
||||
@@ -274,7 +276,7 @@ namespace Convention.WindowsUI.Variant
|
||||
parent.m_Entrys.Add(this);
|
||||
layer = 0;
|
||||
}
|
||||
public ItemEntry(ItemEntry parent) : base(null)
|
||||
public ItemEntry(ItemEntry parent)
|
||||
{
|
||||
childs = new();
|
||||
this.parentEntry = parent;
|
||||
@@ -401,7 +403,6 @@ namespace Convention.WindowsUI.Variant
|
||||
private RectTransform m_ContentPlaneWhenNoWindow;
|
||||
[Content, SerializeField, OnlyPlayMode] private List<ItemEntry> m_Entrys = new();
|
||||
[Resources, SerializeField, HopeNotNull] public WindowUIModule ItemPrefab;
|
||||
[Setting, Tooltip("RUNTIME MODE")] public PerformanceIndicator.PerformanceMode m_PerformanceMode = PerformanceIndicator.PerformanceMode.Quality;
|
||||
|
||||
public RectTransform TargetWindowContent => m_WindowManager == null ? m_ContentPlaneWhenNoWindow : m_WindowManager[m_TargetWindowContent];
|
||||
|
||||
|
@@ -54,7 +54,7 @@ namespace Convention.WindowsUI.Variant
|
||||
}
|
||||
|
||||
[ArgPackage]
|
||||
public class CallbackData : AnyClass
|
||||
public class CallbackData
|
||||
{
|
||||
public string name;
|
||||
public Action<Vector3> callback;
|
||||
@@ -65,7 +65,7 @@ namespace Convention.WindowsUI.Variant
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>root
|
||||
///
|
||||
/// </summary>
|
||||
[return: ReturnNotNull, IsInstantiated(true)]
|
||||
public CustomMenu OpenCustomMenu([In] RectTransform root, params CallbackData[] actions)
|
||||
|
Reference in New Issue
Block a user