From 085c79441b68317b97c75bf082354d8b362875fa Mon Sep 17 00:00:00 2001 From: Sinai Date: Fri, 16 Apr 2021 21:07:32 +1000 Subject: [PATCH] Create preliminary GameObject inspector for testing, cleanup some UI --- src/UI/Panels/GameObjectInspector.cs | 128 ++++++++++++++++++ src/UI/Panels/SceneExplorer.cs | 15 +- src/UI/UIFactory.cs | 11 +- src/UI/UIManager.cs | 5 +- src/UI/Widgets/InfiniteScroll/ICell.cs | 2 +- .../Widgets/InfiniteScroll/IListDataSource.cs | 2 +- .../InfiniteScroll/InfiniteScrollRect.cs | 2 +- src/UI/Widgets/InfiniteScroll/UIExtensions.cs | 2 +- src/UI/Widgets/SimpleList/SimpleCell.cs | 74 ++++++++++ src/UI/Widgets/SimpleList/SimpleListSource.cs | 95 +++++++++++++ src/UI/Widgets/TransformTree/TransformCell.cs | 2 +- src/UI/Widgets/TransformTree/TransformTree.cs | 2 +- src/UnityExplorer.csproj | 4 + 13 files changed, 322 insertions(+), 22 deletions(-) create mode 100644 src/UI/Panels/GameObjectInspector.cs create mode 100644 src/UI/Widgets/SimpleList/SimpleCell.cs create mode 100644 src/UI/Widgets/SimpleList/SimpleListSource.cs diff --git a/src/UI/Panels/GameObjectInspector.cs b/src/UI/Panels/GameObjectInspector.cs new file mode 100644 index 0000000..9b9cc6a --- /dev/null +++ b/src/UI/Panels/GameObjectInspector.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using UnityEngine; +using UnityEngine.UI; +using UnityExplorer.Core.Config; +using UnityExplorer.Core.Runtime; +using UnityExplorer.UI.Models; +using UnityExplorer.UI.Utility; +using UnityExplorer.UI.Widgets; + +namespace UnityExplorer.UI.Panels +{ + public class GameObjectInspector : UIPanel + { + public override string Name => "GameObject Inspector"; + + public SimpleListSource ComponentList; + + public override void Update() + { + + } + + public List GetEntries() + { + var comp = Camera.main; + return new List + { + comp, comp, comp, comp, comp + }; + } + + public SimpleCell CreateCell(RectTransform rect) + { + var button = rect.GetComponentInChildren