From a46bc11e42eb6fc6903de6f12e49c57d2cb068b8 Mon Sep 17 00:00:00 2001 From: sinaioutlander <49360850+sinaioutlander@users.noreply.github.com> Date: Tue, 3 Nov 2020 20:59:13 +1100 Subject: [PATCH] more progress, GameObject inspector almost done --- src/CacheObject/CacheEnumerated.cs | 4 +- src/CacheObject/CacheFactory.cs | 4 +- src/CacheObject/CacheField.cs | 6 +- src/CacheObject/CacheMember.cs | 6 +- src/CacheObject/CacheMethod.cs | 6 +- src/CacheObject/CacheObjectBase.cs | 8 +- src/CacheObject/CacheProperty.cs | 6 +- src/Config/ModConfig.cs | 2 +- src/ExplorerBepInPlugin.cs | 4 +- src/ExplorerCore.cs | 16 +- src/ExplorerMelonMod.cs | 2 +- src/Extensions/ReflectionExtensions.cs | 4 +- src/Extensions/UnityExtensions.cs | 12 +- src/Helpers/ICallHelper.cs | 2 +- src/Helpers/ReflectionHelpers.cs | 2 +- src/Helpers/Texture2DHelpers.cs | 4 +- src/Helpers/UnityHelpers.cs | 2 +- src/Input/IHandleInput.cs | 2 +- src/Input/InputManager.cs | 4 +- src/Input/InputSystem.cs | 4 +- src/Input/LegacyInput.cs | 4 +- src/Input/NoInput.cs | 2 +- src/Properties/AssemblyInfo.cs | 4 +- src/Tests/Tests.cs | 4 +- src/UI/ForceUnlockCursor.cs | 6 +- src/UI/InteractiveValue/InteractiveValue.cs | 8 +- src/UI/Main/Console/AutoCompleter.cs | 2 +- src/UI/Main/Console/CSharpLexer.cs | 10 +- src/UI/Main/Console/CodeEditor.cs | 6 +- src/UI/Main/Console/Lexer/CommentMatch.cs | 10 +- src/UI/Main/Console/Lexer/ILexer.cs | 19 - src/UI/Main/Console/Lexer/InputLexer.cs | 20 +- src/UI/Main/Console/Lexer/KeywordMatch.cs | 6 +- .../Lexer/{MatchLexer.cs => Matcher.cs} | 10 +- src/UI/Main/Console/Lexer/NumberMatch.cs | 6 +- src/UI/Main/Console/Lexer/StringMatch.cs | 8 +- src/UI/Main/Console/Lexer/SymbolMatch.cs | 6 +- src/UI/Main/Console/ScriptEvaluator.cs | 2 +- src/UI/Main/Console/ScriptInteraction.cs | 2 +- src/UI/Main/Console/Suggestion.cs | 2 +- src/UI/Main/ConsolePage.cs | 15 +- src/UI/Main/DebugConsole.cs | 4 +- src/UI/Main/HomePage.cs | 2 +- src/UI/Main/InspectorManager.cs | 10 +- src/UI/Main/Inspectors/GameObjectInspector.cs | 830 +++++++++++++++--- src/UI/Main/Inspectors/InspectorBase.cs | 12 +- src/UI/Main/Inspectors/InstanceInspector.cs | 4 +- src/UI/Main/Inspectors/ReflectionInspector.cs | 12 +- src/UI/Main/Inspectors/StaticInspector.cs | 2 +- src/UI/Main/MainMenu.cs | 13 +- src/UI/Main/OptionsPage.cs | 2 +- src/UI/Main/PanelDragger.cs | 6 +- src/UI/Main/SceneExplorer.cs | 118 +-- src/UI/Main/SearchPage.cs | 2 +- src/UI/Shared/PageHandler.cs | 71 +- src/UI/Shared/Syntax.cs | 2 +- src/UI/UIFactory.cs | 3 +- src/UI/UIManager.cs | 4 +- src/{Explorer.csproj => UnityExplorer.csproj} | 7 +- src/{Explorer.sln => UnityExplorer.sln} | 2 +- .../ColorUtility/ColorUtilityUnstrip.cs | 34 +- .../ImageConversion/ImageConversionUnstrip.cs | 4 +- src/Unstrip/LayerMask/LayerMaskUnstrip.cs | 4 +- src/Unstrip/Resources/ResourcesUnstrip.cs | 4 +- src/Unstrip/Scene/SceneUnstrip.cs | 24 +- 65 files changed, 1043 insertions(+), 385 deletions(-) delete mode 100644 src/UI/Main/Console/Lexer/ILexer.cs rename src/UI/Main/Console/Lexer/{MatchLexer.cs => Matcher.cs} (73%) rename src/{Explorer.csproj => UnityExplorer.csproj} (98%) rename src/{Explorer.sln => UnityExplorer.sln} (92%) diff --git a/src/CacheObject/CacheEnumerated.cs b/src/CacheObject/CacheEnumerated.cs index d750e9a..201f2ea 100644 --- a/src/CacheObject/CacheEnumerated.cs +++ b/src/CacheObject/CacheEnumerated.cs @@ -3,9 +3,9 @@ //using System.Collections.Generic; //using System.Linq; //using System.Text; -//using ExplorerBeta.UI; +//using UnityExplorer.UI; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheEnumerated : CacheObjectBase // { diff --git a/src/CacheObject/CacheFactory.cs b/src/CacheObject/CacheFactory.cs index 3b27307..16564b7 100644 --- a/src/CacheObject/CacheFactory.cs +++ b/src/CacheObject/CacheFactory.cs @@ -1,8 +1,8 @@ //using System; //using System.Reflection; -//using ExplorerBeta.CacheObject; +//using UnityExplorer.CacheObject; //using UnityEngine; -//using ExplorerBeta.Helpers; +//using UnityExplorer.Helpers; //namespace Explorer //{ diff --git a/src/CacheObject/CacheField.cs b/src/CacheObject/CacheField.cs index 2a0fc41..68d4809 100644 --- a/src/CacheObject/CacheField.cs +++ b/src/CacheObject/CacheField.cs @@ -3,10 +3,10 @@ //using System.Linq; //using System.Text; //using System.Reflection; -//using ExplorerBeta.UI; -//using ExplorerBeta.Helpers; +//using UnityExplorer.UI; +//using UnityExplorer.Helpers; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheField : CacheMember // { diff --git a/src/CacheObject/CacheMember.cs b/src/CacheObject/CacheMember.cs index 19cd677..ef8e0a4 100644 --- a/src/CacheObject/CacheMember.cs +++ b/src/CacheObject/CacheMember.cs @@ -3,10 +3,10 @@ //using System.Linq; //using System.Reflection; //using UnityEngine; -//using ExplorerBeta.UI; -//using ExplorerBeta.UI.Shared; +//using UnityExplorer.UI; +//using UnityExplorer.UI.Shared; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheMember : CacheObjectBase // { diff --git a/src/CacheObject/CacheMethod.cs b/src/CacheObject/CacheMethod.cs index e2e4a17..a2b08be 100644 --- a/src/CacheObject/CacheMethod.cs +++ b/src/CacheObject/CacheMethod.cs @@ -3,10 +3,10 @@ //using System.Linq; //using System.Reflection; //using UnityEngine; -//using ExplorerBeta.UI.Shared; -//using ExplorerBeta.Helpers; +//using UnityExplorer.UI.Shared; +//using UnityExplorer.Helpers; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheMethod : CacheMember // { diff --git a/src/CacheObject/CacheObjectBase.cs b/src/CacheObject/CacheObjectBase.cs index 416755b..acedf1a 100644 --- a/src/CacheObject/CacheObjectBase.cs +++ b/src/CacheObject/CacheObjectBase.cs @@ -3,11 +3,11 @@ //using System.Linq; //using System.Reflection; //using UnityEngine; -//using ExplorerBeta.UI; -//using ExplorerBeta.UI.Shared; -//using ExplorerBeta.Helpers; +//using UnityExplorer.UI; +//using UnityExplorer.UI.Shared; +//using UnityExplorer.Helpers; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheObjectBase // { diff --git a/src/CacheObject/CacheProperty.cs b/src/CacheObject/CacheProperty.cs index 317535a..8f0b9c9 100644 --- a/src/CacheObject/CacheProperty.cs +++ b/src/CacheObject/CacheProperty.cs @@ -3,10 +3,10 @@ //using System.Linq; //using System.Text; //using System.Reflection; -//using ExplorerBeta.UI; -//using ExplorerBeta.Helpers; +//using UnityExplorer.UI; +//using UnityExplorer.Helpers; -//namespace ExplorerBeta.CacheObject +//namespace UnityExplorer.CacheObject //{ // public class CacheProperty : CacheMember // { diff --git a/src/Config/ModConfig.cs b/src/Config/ModConfig.cs index 197ff98..8f73d76 100644 --- a/src/Config/ModConfig.cs +++ b/src/Config/ModConfig.cs @@ -2,7 +2,7 @@ using System.Xml.Serialization; using UnityEngine; -namespace ExplorerBeta.Config +namespace UnityExplorer.Config { public class ModConfig { diff --git a/src/ExplorerBepInPlugin.cs b/src/ExplorerBepInPlugin.cs index aa8933c..0b03c96 100644 --- a/src/ExplorerBepInPlugin.cs +++ b/src/ExplorerBepInPlugin.cs @@ -12,9 +12,9 @@ using UnhollowerRuntimeLib; using BepInEx.IL2CPP; #endif -namespace ExplorerBeta +namespace UnityExplorer { - [BepInPlugin(ExplorerCore.GUID, "ExplorerBeta", ExplorerCore.VERSION)] + [BepInPlugin(ExplorerCore.GUID, "UnityExplorer", ExplorerCore.VERSION)] #if CPP public class ExplorerBepInPlugin : BasePlugin #else diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 6c84c1d..b9939c4 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -1,18 +1,18 @@ using System; -using ExplorerBeta.Config; -using ExplorerBeta.Input; -using ExplorerBeta.UI; -using ExplorerBeta.UI.Main; +using UnityExplorer.Config; +using UnityExplorer.Input; +using UnityExplorer.UI; +using UnityExplorer.UI.Main; using UnityEngine; -namespace ExplorerBeta +namespace UnityExplorer { public class ExplorerCore { - public const string NAME = "Explorer " + VERSION + " (" + PLATFORM + ", " + MODLOADER + ")"; + public const string NAME = "UnityExplorer " + VERSION + " (" + PLATFORM + ", " + MODLOADER + ")"; public const string VERSION = "3.0.0"; public const string AUTHOR = "Sinai"; - public const string GUID = "com.sinai.explorerBETA"; + public const string GUID = "com.sinai.unityexplorer"; public const string PLATFORM = #if CPP @@ -107,7 +107,7 @@ namespace ExplorerBeta try { UIManager.Init(); - Log("Initialized Explorer UI."); + Log("Initialized UnityExplorer UI."); } catch (Exception e) { diff --git a/src/ExplorerMelonMod.cs b/src/ExplorerMelonMod.cs index 816d68d..a2736a8 100644 --- a/src/ExplorerMelonMod.cs +++ b/src/ExplorerMelonMod.cs @@ -1,7 +1,7 @@ #if ML using MelonLoader; -namespace ExplorerBeta +namespace UnityExplorer { public class ExplorerMelonMod : MelonMod { diff --git a/src/Extensions/ReflectionExtensions.cs b/src/Extensions/ReflectionExtensions.cs index 44e7590..8e80eda 100644 --- a/src/Extensions/ReflectionExtensions.cs +++ b/src/Extensions/ReflectionExtensions.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -using ExplorerBeta.Helpers; +using UnityExplorer.Helpers; -namespace ExplorerBeta +namespace UnityExplorer { public static class ReflectionExtensions { diff --git a/src/Extensions/UnityExtensions.cs b/src/Extensions/UnityExtensions.cs index a7019ab..bede877 100644 --- a/src/Extensions/UnityExtensions.cs +++ b/src/Extensions/UnityExtensions.cs @@ -1,17 +1,17 @@ using UnityEngine; -namespace ExplorerBeta +namespace UnityExplorer { public static class UnityExtensions { - public static string GetTransformPath(this Transform _transform) + public static string GetTransformPath(this Transform t, bool includeThisName = false) { - string path = _transform.name; + string path = includeThisName ? t.transform.name : ""; - while (_transform.parent != null) + while (t.parent != null) { - _transform = _transform.parent; - path = _transform.name + "/" + path; + t = t.parent; + path = $"{t.name}/{path}"; } return path; diff --git a/src/Helpers/ICallHelper.cs b/src/Helpers/ICallHelper.cs index ab4fe77..11f5f33 100644 --- a/src/Helpers/ICallHelper.cs +++ b/src/Helpers/ICallHelper.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; -namespace ExplorerBeta.Helpers +namespace UnityExplorer.Helpers { [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "External methods")] public static class ICallHelper diff --git a/src/Helpers/ReflectionHelpers.cs b/src/Helpers/ReflectionHelpers.cs index 76e0405..9a63832 100644 --- a/src/Helpers/ReflectionHelpers.cs +++ b/src/Helpers/ReflectionHelpers.cs @@ -13,7 +13,7 @@ using UnhollowerRuntimeLib; using System.Runtime.InteropServices; #endif -namespace ExplorerBeta.Helpers +namespace UnityExplorer.Helpers { [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "External methods")] public class ReflectionHelpers diff --git a/src/Helpers/Texture2DHelpers.cs b/src/Helpers/Texture2DHelpers.cs index d39d0da..7f49814 100644 --- a/src/Helpers/Texture2DHelpers.cs +++ b/src/Helpers/Texture2DHelpers.cs @@ -3,10 +3,10 @@ using UnityEngine; using System.IO; using System.Reflection; #if CPP -using ExplorerBeta.Unstrip.ImageConversion; +using UnityExplorer.Unstrip.ImageConversion; #endif -namespace ExplorerBeta.Helpers +namespace UnityExplorer.Helpers { public static class Texture2DHelpers { diff --git a/src/Helpers/UnityHelpers.cs b/src/Helpers/UnityHelpers.cs index bd01f65..d0928e0 100644 --- a/src/Helpers/UnityHelpers.cs +++ b/src/Helpers/UnityHelpers.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace ExplorerBeta.Helpers +namespace UnityExplorer.Helpers { public class UnityHelpers { diff --git a/src/Input/IHandleInput.cs b/src/Input/IHandleInput.cs index df4d509..a2e9d8e 100644 --- a/src/Input/IHandleInput.cs +++ b/src/Input/IHandleInput.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace ExplorerBeta.Input +namespace UnityExplorer.Input { public interface IHandleInput { diff --git a/src/Input/InputManager.cs b/src/Input/InputManager.cs index 81fab4f..81015a4 100644 --- a/src/Input/InputManager.cs +++ b/src/Input/InputManager.cs @@ -1,12 +1,12 @@ using System; using UnityEngine; -using ExplorerBeta.Helpers; +using UnityExplorer.Helpers; using System.Diagnostics.CodeAnalysis; #if CPP using UnhollowerBaseLib; #endif -namespace ExplorerBeta.Input +namespace UnityExplorer.Input { [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Unity style")] public static class InputManager diff --git a/src/Input/InputSystem.cs b/src/Input/InputSystem.cs index 00d99fc..79157a9 100644 --- a/src/Input/InputSystem.cs +++ b/src/Input/InputSystem.cs @@ -1,9 +1,9 @@ using System; using System.Reflection; -using ExplorerBeta.Helpers; +using UnityExplorer.Helpers; using UnityEngine; -namespace ExplorerBeta.Input +namespace UnityExplorer.Input { public class InputSystem : IHandleInput { diff --git a/src/Input/LegacyInput.cs b/src/Input/LegacyInput.cs index b28558c..d4dc042 100644 --- a/src/Input/LegacyInput.cs +++ b/src/Input/LegacyInput.cs @@ -1,9 +1,9 @@ using System; using System.Reflection; -using ExplorerBeta.Helpers; +using UnityExplorer.Helpers; using UnityEngine; -namespace ExplorerBeta.Input +namespace UnityExplorer.Input { public class LegacyInput : IHandleInput { diff --git a/src/Input/NoInput.cs b/src/Input/NoInput.cs index 4accd67..7fe18a7 100644 --- a/src/Input/NoInput.cs +++ b/src/Input/NoInput.cs @@ -1,6 +1,6 @@ using UnityEngine; -namespace ExplorerBeta.Input +namespace UnityExplorer.Input { // Just a stub for games where no Input module was able to load at all. diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index 037709c..2994beb 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -1,11 +1,11 @@ using System.Reflection; using System.Runtime.InteropServices; -using ExplorerBeta; +using UnityExplorer; #if ML using MelonLoader; -[assembly: MelonInfo(typeof(ExplorerMelonMod), "ExplorerBeta", ExplorerCore.VERSION, ExplorerCore.AUTHOR)] +[assembly: MelonInfo(typeof(ExplorerMelonMod), "UnityExplorer", ExplorerCore.VERSION, ExplorerCore.AUTHOR)] [assembly: MelonGame(null, null)] #endif diff --git a/src/Tests/Tests.cs b/src/Tests/Tests.cs index e61f126..4143a9b 100644 --- a/src/Tests/Tests.cs +++ b/src/Tests/Tests.cs @@ -1,11 +1,11 @@ using System.Collections; using System.Collections.Generic; -using ExplorerBeta.UI; +using UnityExplorer.UI; using UnityEngine; #if CPP #endif -namespace ExplorerBeta.Tests +namespace UnityExplorer.Tests { public static class StaticTestClass { diff --git a/src/UI/ForceUnlockCursor.cs b/src/UI/ForceUnlockCursor.cs index fc8e5fe..f9bcc34 100644 --- a/src/UI/ForceUnlockCursor.cs +++ b/src/UI/ForceUnlockCursor.cs @@ -1,8 +1,8 @@ using System; using UnityEngine; -using ExplorerBeta.Helpers; +using UnityExplorer.Helpers; using UnityEngine.EventSystems; -using ExplorerBeta.Input; +using UnityExplorer.Input; using BF = System.Reflection.BindingFlags; #if ML using Harmony; @@ -10,7 +10,7 @@ using Harmony; using HarmonyLib; #endif -namespace ExplorerBeta.UI +namespace UnityExplorer.UI { public class ForceUnlockCursor { diff --git a/src/UI/InteractiveValue/InteractiveValue.cs b/src/UI/InteractiveValue/InteractiveValue.cs index 603f490..bead31f 100644 --- a/src/UI/InteractiveValue/InteractiveValue.cs +++ b/src/UI/InteractiveValue/InteractiveValue.cs @@ -3,11 +3,11 @@ //using System.Linq; //using System.Reflection; //using UnityEngine; -//using ExplorerBeta.CacheObject; -//using ExplorerBeta.Helpers; -//using ExplorerBeta.UI.Shared; +//using UnityExplorer.CacheObject; +//using UnityExplorer.Helpers; +//using UnityExplorer.UI.Shared; -//namespace ExplorerBeta.UI +//namespace UnityExplorer.UI //{ // public class InteractiveValue // { diff --git a/src/UI/Main/Console/AutoCompleter.cs b/src/UI/Main/Console/AutoCompleter.cs index 1455175..05ebc21 100644 --- a/src/UI/Main/Console/AutoCompleter.cs +++ b/src/UI/Main/Console/AutoCompleter.cs @@ -7,7 +7,7 @@ using UnityEngine.UI; #if CPP #endif -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public class AutoCompleter { diff --git a/src/UI/Main/Console/CSharpLexer.cs b/src/UI/Main/Console/CSharpLexer.cs index c901d40..c820b47 100644 --- a/src/UI/Main/Console/CSharpLexer.cs +++ b/src/UI/Main/Console/CSharpLexer.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using System.Text; -using ExplorerBeta.UI.Main.Console.Lexer; +using UnityExplorer.UI.Main.Console.Lexer; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public static class CSharpLexer { @@ -73,14 +73,14 @@ namespace ExplorerBeta.UI.Main.Console } } - private static MatchLexer[] matchers = null; - internal static MatchLexer[] Matchers + private static Matcher[] matchers = null; + internal static Matcher[] Matchers { get { if (matchers == null) { - List matcherList = new List + List matcherList = new List { commentMatcher, symbolMatcher, diff --git a/src/UI/Main/Console/CodeEditor.cs b/src/UI/Main/Console/CodeEditor.cs index 21aa5d6..579e509 100644 --- a/src/UI/Main/Console/CodeEditor.cs +++ b/src/UI/Main/Console/CodeEditor.cs @@ -1,14 +1,14 @@ using System; using System.Linq; using System.Text; -using ExplorerBeta.Input; -using ExplorerBeta.UI.Main.Console.Lexer; +using UnityExplorer.Input; +using UnityExplorer.UI.Main.Console.Lexer; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public class CodeEditor { diff --git a/src/UI/Main/Console/Lexer/CommentMatch.cs b/src/UI/Main/Console/Lexer/CommentMatch.cs index b67338e..7e38d19 100644 --- a/src/UI/Main/Console/Lexer/CommentMatch.cs +++ b/src/UI/Main/Console/Lexer/CommentMatch.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public sealed class CommentMatch : MatchLexer + public sealed class CommentMatch : Matcher { public string lineCommentStart = @"//"; public string blockCommentStart = @"/*"; @@ -12,9 +12,9 @@ namespace ExplorerBeta.UI.Main.Console.Lexer public override Color HighlightColor => new Color(0.34f, 0.65f, 0.29f, 1.0f); public override IEnumerable StartChars => new char[] { lineCommentStart[0], blockCommentStart[0] }; public override IEnumerable EndChars => new char[] { blockCommentEnd[0] }; - public override bool IsImplicitMatch(ILexer lexer) => IsMatch(lexer, lineCommentStart) || IsMatch(lexer, blockCommentStart); + public override bool IsImplicitMatch(InputLexer lexer) => IsMatch(lexer, lineCommentStart) || IsMatch(lexer, blockCommentStart); - private bool IsMatch(ILexer lexer, string commentType) + private bool IsMatch(InputLexer lexer, string commentType) { if (!string.IsNullOrEmpty(commentType)) { @@ -44,6 +44,6 @@ namespace ExplorerBeta.UI.Main.Console.Lexer return false; } - private bool IsEndLineOrEndFile(ILexer lexer, char character) => lexer.EndOfStream || character == '\n' || character == '\r'; + private bool IsEndLineOrEndFile(InputLexer lexer, char character) => lexer.EndOfStream || character == '\n' || character == '\r'; } } diff --git a/src/UI/Main/Console/Lexer/ILexer.cs b/src/UI/Main/Console/Lexer/ILexer.cs deleted file mode 100644 index 0e97959..0000000 --- a/src/UI/Main/Console/Lexer/ILexer.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace ExplorerBeta.UI.Main.Console.Lexer -{ - public enum SpecialCharacterPosition - { - Start, - End, - }; - - public interface ILexer - { - bool EndOfStream { get; } - char Previous { get; } - - char ReadNext(); - void Rollback(int amount = -1); - void Commit(); - bool IsSpecialSymbol(char character, SpecialCharacterPosition position = SpecialCharacterPosition.Start); - } -} diff --git a/src/UI/Main/Console/Lexer/InputLexer.cs b/src/UI/Main/Console/Lexer/InputLexer.cs index a2c08f4..10d3845 100644 --- a/src/UI/Main/Console/Lexer/InputLexer.cs +++ b/src/UI/Main/Console/Lexer/InputLexer.cs @@ -1,18 +1,24 @@ using System.Collections.Generic; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - internal struct LexerMatchInfo + public struct LexerMatchInfo { public int startIndex; public int endIndex; public string htmlColor; } - internal class InputLexer : ILexer + public enum SpecialCharacterPosition + { + Start, + End, + }; + + public class InputLexer { private string inputString = null; - private MatchLexer[] matchers = null; + private Matcher[] matchers = null; private readonly HashSet specialStartSymbols = new HashSet(); private readonly HashSet specialEndSymbols = new HashSet(); private int currentIndex = 0; @@ -26,7 +32,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer get { return currentLookaheadIndex >= inputString.Length; } } - public void UseMatchers(char[] delimiters, MatchLexer[] matchers) + public void UseMatchers(char[] delimiters, Matcher[] matchers) { this.matchers = matchers; @@ -51,7 +57,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer if (matchers != null) { - foreach (MatchLexer lexer in matchers) + foreach (Matcher lexer in matchers) { foreach (char special in lexer.StartChars) { @@ -91,7 +97,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer ReadWhiteSpace(); - foreach (MatchLexer matcher in matchers) + foreach (Matcher matcher in matchers) { int startIndex = currentIndex; diff --git a/src/UI/Main/Console/Lexer/KeywordMatch.cs b/src/UI/Main/Console/Lexer/KeywordMatch.cs index cd28112..dc6ceae 100644 --- a/src/UI/Main/Console/Lexer/KeywordMatch.cs +++ b/src/UI/Main/Console/Lexer/KeywordMatch.cs @@ -1,9 +1,9 @@ using System.Collections.Generic; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public sealed class KeywordMatch : MatchLexer + public sealed class KeywordMatch : Matcher { public string keywords; @@ -14,7 +14,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer private readonly Stack removeList = new Stack(); public string[] keywordCache = null; - public override bool IsImplicitMatch(ILexer lexer) + public override bool IsImplicitMatch(InputLexer lexer) { BuildKeywordCache(); diff --git a/src/UI/Main/Console/Lexer/MatchLexer.cs b/src/UI/Main/Console/Lexer/Matcher.cs similarity index 73% rename from src/UI/Main/Console/Lexer/MatchLexer.cs rename to src/UI/Main/Console/Lexer/Matcher.cs index d55ea32..955f0bd 100644 --- a/src/UI/Main/Console/Lexer/MatchLexer.cs +++ b/src/UI/Main/Console/Lexer/Matcher.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; -using ExplorerBeta.Unstrip.ColorUtility; +using UnityExplorer.Unstrip.ColorUtility; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public abstract class MatchLexer + public abstract class Matcher { public abstract Color HighlightColor { get; } @@ -14,9 +14,9 @@ namespace ExplorerBeta.UI.Main.Console.Lexer public virtual IEnumerable StartChars { get { yield break; } } public virtual IEnumerable EndChars { get { yield break; } } - public abstract bool IsImplicitMatch(ILexer lexer); + public abstract bool IsImplicitMatch(InputLexer lexer); - public bool IsMatch(ILexer lexer) + public bool IsMatch(InputLexer lexer) { if (IsImplicitMatch(lexer)) { diff --git a/src/UI/Main/Console/Lexer/NumberMatch.cs b/src/UI/Main/Console/Lexer/NumberMatch.cs index b86c426..a3efb9e 100644 --- a/src/UI/Main/Console/Lexer/NumberMatch.cs +++ b/src/UI/Main/Console/Lexer/NumberMatch.cs @@ -1,12 +1,12 @@ using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public sealed class NumberMatch : MatchLexer + public sealed class NumberMatch : Matcher { public override Color HighlightColor => new Color(0.58f, 0.33f, 0.33f, 1.0f); - public override bool IsImplicitMatch(ILexer lexer) + public override bool IsImplicitMatch(InputLexer lexer) { if (!char.IsWhiteSpace(lexer.Previous) && !lexer.IsSpecialSymbol(lexer.Previous, SpecialCharacterPosition.End)) diff --git a/src/UI/Main/Console/Lexer/StringMatch.cs b/src/UI/Main/Console/Lexer/StringMatch.cs index 9629583..4053d6f 100644 --- a/src/UI/Main/Console/Lexer/StringMatch.cs +++ b/src/UI/Main/Console/Lexer/StringMatch.cs @@ -1,16 +1,16 @@ using System.Collections.Generic; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public sealed class StringMatch : MatchLexer + public sealed class StringMatch : Matcher { public override Color HighlightColor => new Color(0.79f, 0.52f, 0.32f, 1.0f); public override IEnumerable StartChars { get { yield return '"'; } } public override IEnumerable EndChars { get { yield return '"'; } } - public override bool IsImplicitMatch(ILexer lexer) + public override bool IsImplicitMatch(InputLexer lexer) { if (lexer.ReadNext() == '"') { @@ -24,7 +24,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer return false; } - private bool IsClosingQuoteOrEndFile(ILexer lexer, char character) + private bool IsClosingQuoteOrEndFile(InputLexer lexer, char character) { if (lexer.EndOfStream == true || character == '"') diff --git a/src/UI/Main/Console/Lexer/SymbolMatch.cs b/src/UI/Main/Console/Lexer/SymbolMatch.cs index 9b1b218..e9de316 100644 --- a/src/UI/Main/Console/Lexer/SymbolMatch.cs +++ b/src/UI/Main/Console/Lexer/SymbolMatch.cs @@ -2,9 +2,9 @@ using System.Linq; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console.Lexer +namespace UnityExplorer.UI.Main.Console.Lexer { - public sealed class SymbolMatch : MatchLexer + public sealed class SymbolMatch : Matcher { public override Color HighlightColor => new Color(0.58f, 0.47f, 0.37f, 1.0f); @@ -39,7 +39,7 @@ namespace ExplorerBeta.UI.Main.Console.Lexer } } - public override bool IsImplicitMatch(ILexer lexer) + public override bool IsImplicitMatch(InputLexer lexer) { if (lexer == null) { diff --git a/src/UI/Main/Console/ScriptEvaluator.cs b/src/UI/Main/Console/ScriptEvaluator.cs index d0c70f0..9784617 100644 --- a/src/UI/Main/Console/ScriptEvaluator.cs +++ b/src/UI/Main/Console/ScriptEvaluator.cs @@ -6,7 +6,7 @@ using Mono.CSharp; // Thanks to ManlyMarco for this -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public class ScriptEvaluator : Evaluator, IDisposable { diff --git a/src/UI/Main/Console/ScriptInteraction.cs b/src/UI/Main/Console/ScriptInteraction.cs index e88338f..a80af9e 100644 --- a/src/UI/Main/Console/ScriptInteraction.cs +++ b/src/UI/Main/Console/ScriptInteraction.cs @@ -1,7 +1,7 @@ using System; using Mono.CSharp; -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public class ScriptInteraction : InteractiveBase { diff --git a/src/UI/Main/Console/Suggestion.cs b/src/UI/Main/Console/Suggestion.cs index 00ef14a..7b9602c 100644 --- a/src/UI/Main/Console/Suggestion.cs +++ b/src/UI/Main/Console/Suggestion.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Reflection; using UnityEngine; -namespace ExplorerBeta.UI.Main.Console +namespace UnityExplorer.UI.Main.Console { public struct Suggestion { diff --git a/src/UI/Main/ConsolePage.cs b/src/UI/Main/ConsolePage.cs index de56aab..e2fe45c 100644 --- a/src/UI/Main/ConsolePage.cs +++ b/src/UI/Main/ConsolePage.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; -using ExplorerBeta.UI.Main.Console; -using ExplorerBeta.Unstrip.Resources; +using UnityExplorer.UI.Main.Console; +using UnityExplorer.Unstrip.Resources; using TMPro; using UnityEngine; using UnityEngine.UI; @@ -12,7 +12,7 @@ using UnityEngine.UI; using UnhollowerRuntimeLib; #endif -namespace ExplorerBeta.UI.Main +namespace UnityExplorer.UI.Main { public class ConsolePage : MainMenu.Page { @@ -321,17 +321,24 @@ namespace ExplorerBeta.UI.Main mainTextInput.fontSize = 18; var placeHolderText = textAreaObj.transform.Find("Placeholder").GetComponent(); - placeHolderText.text = @"Welcome to the Explorer C# Console. + placeHolderText.text = @"Welcome to the UnityExplorer C# Console. The following helper methods are available: * Log(""message""); logs a message to the debug console + * CurrentTarget(); returns the currently inspected target on the Home page + * AllTargets(); returns an object[] array containing all inspected instances + * Inspect(someObject) to inspect an instance, eg. Inspect(Camera.main); + * Inspect(typeof(SomeClass)) to inspect a Class with static reflection + * AddUsing(""SomeNamespace""); adds a using directive to the C# console + * GetUsing(); logs the current using directives to the debug console + * Reset(); resets all using directives and variables "; diff --git a/src/UI/Main/DebugConsole.cs b/src/UI/Main/DebugConsole.cs index e0ba92e..6a2b2e3 100644 --- a/src/UI/Main/DebugConsole.cs +++ b/src/UI/Main/DebugConsole.cs @@ -1,13 +1,13 @@ using System; using System.Collections.Generic; -using ExplorerBeta.Unstrip.ColorUtility; +using UnityExplorer.Unstrip.ColorUtility; using TMPro; using UnityEngine; using UnityEngine.UI; #if CPP #endif -namespace ExplorerBeta.UI.Main +namespace UnityExplorer.UI.Main { public class DebugConsole { diff --git a/src/UI/Main/HomePage.cs b/src/UI/Main/HomePage.cs index 2c46ef9..e671763 100644 --- a/src/UI/Main/HomePage.cs +++ b/src/UI/Main/HomePage.cs @@ -4,7 +4,7 @@ using System.Linq; using UnityEngine; using UnityEngine.UI; -namespace ExplorerBeta.UI.Main +namespace UnityExplorer.UI.Main { public class HomePage : MainMenu.Page { diff --git a/src/UI/Main/InspectorManager.cs b/src/UI/Main/InspectorManager.cs index 162b87d..a56f274 100644 --- a/src/UI/Main/InspectorManager.cs +++ b/src/UI/Main/InspectorManager.cs @@ -1,15 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; -using ExplorerBeta.Helpers; -using ExplorerBeta.UI.Main.Inspectors; -using ExplorerBeta.UI.Shared; -using ExplorerBeta.Unstrip.Scenes; +using UnityExplorer.Helpers; +using UnityExplorer.UI.Main.Inspectors; +using UnityExplorer.UI.Shared; +using UnityExplorer.Unstrip.Scenes; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; -namespace ExplorerBeta.UI.Main +namespace UnityExplorer.UI.Main { public class InspectorManager { diff --git a/src/UI/Main/Inspectors/GameObjectInspector.cs b/src/UI/Main/Inspectors/GameObjectInspector.cs index 45fd036..2a628cf 100644 --- a/src/UI/Main/Inspectors/GameObjectInspector.cs +++ b/src/UI/Main/Inspectors/GameObjectInspector.cs @@ -1,16 +1,19 @@ using System; using System.Collections.Generic; -using ExplorerBeta.Helpers; +using System.Linq; +using UnityExplorer.Helpers; +using UnityExplorer.UI.Shared; +using UnityExplorer.Unstrip.ColorUtility; using TMPro; using UnityEngine; using UnityEngine.UI; +using UnityExplorer.Unstrip.LayerMasks; -namespace ExplorerBeta.UI.Main.Inspectors +namespace UnityExplorer.UI.Main.Inspectors { // TODO: - // make page handler for children and component lists - // -- clicking a child.. open new tab or change this tab target? - // make top info panel (path, scene, layer, enabled) + // fix path and name input for very long input (use content size fitter + preffered size + vert layout group) + // make back button (inspect parent button) // make controls panel (transform controls, set parent, etc) public class GameObjectInspector : InspectorBase @@ -20,9 +23,51 @@ namespace ExplorerBeta.UI.Main.Inspectors // just to help with casting in il2cpp public GameObject TargetGO; + // static UI elements (only constructed once) + + private static bool m_UIConstructed; + + private static GameObject m_content; + public override GameObject Content + { + get => m_content; + set => m_content = value; + } + // cached ui elements - public TMP_InputField m_nameInput; - public TMP_InputField m_pathInput; + public static TMP_InputField m_nameInput; + private static string m_lastName; + public static TMP_InputField m_pathInput; + private static string m_lastPath; + private static GameObject m_pathGroupObj; + private static Text m_hiddenPathText; + + private static Toggle m_enabledToggle; + private static Text m_enabledText; + private static bool? m_lastEnabledState; + + private static Dropdown m_layerDropdown; + private static int m_lastLayer = -1; + + private static Text m_sceneText; + private static string m_lastScene; + + // children list + public static PageHandler s_childListPageHandler; + private static GameObject[] s_allChildren = new GameObject[0]; + private static readonly List s_childrenShortlist = new List(); + private static GameObject s_childListContent; + private static readonly List s_childListTexts = new List(); + private static int s_lastChildCount; + + // comp list + public static PageHandler s_compListPageHandler; + private static Component[] s_allComps = new Component[0]; + private static readonly List s_compShortlist = new List(); + private static GameObject s_compListContent; + private static readonly List s_compListTexts = new List(); + private static int s_lastCompCount; + public static readonly List s_compToggles = new List(); public GameObjectInspector(GameObject target) : base(target) { @@ -34,7 +79,12 @@ namespace ExplorerBeta.UI.Main.Inspectors return; } - ConstructUI(); + // one UI is used for all gameobject inspectors. no point recreating it. + if (!m_UIConstructed) + { + ConstructUI(); + m_UIConstructed = true; + } } public override void Update() @@ -46,8 +96,204 @@ namespace ExplorerBeta.UI.Main.Inspectors return; } - m_nameInput.text = TargetGO.name; - m_pathInput.text = TargetGO.transform.GetTransformPath(); + RefreshTopInfo(); + + RefreshChildObjectList(); + + RefreshComponentList(); + } + + private void RefreshTopInfo() + { + if (m_lastName != TargetGO.name) + { + m_lastName = TargetGO.name; + m_nameInput.text = m_lastName; + } + + if (TargetGO.transform.parent) + { + if (!m_pathGroupObj.activeSelf) + m_pathGroupObj.SetActive(true); + + var path = TargetGO.transform.GetTransformPath(true); + if (m_lastPath != path) + { + m_lastPath = path; + m_pathInput.text = path; + m_hiddenPathText.text = path; + } + } + else if (m_pathGroupObj.activeSelf) + m_pathGroupObj.SetActive(false); + + if (m_lastEnabledState != TargetGO.activeSelf) + { + m_lastEnabledState = TargetGO.activeSelf; + + m_enabledToggle.isOn = TargetGO.activeSelf; + m_enabledText.text = TargetGO.activeSelf ? "Enabled" : "Disabled"; + m_enabledText.color = TargetGO.activeSelf ? Color.green : Color.red; + } + + if (m_lastLayer != TargetGO.layer) + { + m_lastLayer = TargetGO.layer; + m_layerDropdown.value = TargetGO.layer; + } + + if (m_lastScene != TargetGO.scene.name) + { + m_lastScene = TargetGO.scene.name; + + if (!string.IsNullOrEmpty(TargetGO.scene.name)) + m_sceneText.text = m_lastScene; + else + m_sceneText.text = "None (Asset/Resource)"; + } + } + + private void RefreshChildObjectList() + { + s_allChildren = new GameObject[TargetGO.transform.childCount]; + for (int i = 0; i < TargetGO.transform.childCount; i++) + { + var child = TargetGO.transform.GetChild(i); + s_allChildren[i] = child.gameObject; + } + + var objects = s_allChildren; + s_childListPageHandler.ListCount = objects.Length; + + //int startIndex = m_sceneListPageHandler.StartIndex; + + int newCount = 0; + + foreach (var itemIndex in s_childListPageHandler) + { + newCount++; + + // normalized index starting from 0 + var i = itemIndex - s_childListPageHandler.StartIndex; + + if (itemIndex >= objects.Length) + { + if (i > s_lastChildCount || i >= s_childListTexts.Count) + break; + + GameObject label = s_childListTexts[i].transform.parent.parent.gameObject; + if (label.activeSelf) + label.SetActive(false); + } + else + { + GameObject obj = objects[itemIndex]; + + if (!obj) + continue; + + if (i >= s_childrenShortlist.Count) + { + s_childrenShortlist.Add(obj); + AddChildListButton(); + } + else + { + s_childrenShortlist[i] = obj; + } + + var text = s_childListTexts[i]; + + var name = obj.name; + + if (obj.transform.childCount > 0) + name = $"[{obj.transform.childCount}] {name}"; + + text.text = name; + text.color = obj.activeSelf ? Color.green : Color.red; + + var label = text.transform.parent.parent.gameObject; + if (!label.activeSelf) + { + label.SetActive(true); + } + } + } + + s_lastChildCount = newCount; + } + + private void RefreshComponentList() + { + s_allComps = TargetGO.GetComponents().ToArray(); + + var components = s_allComps; + s_compListPageHandler.ListCount = components.Length; + + //int startIndex = m_sceneListPageHandler.StartIndex; + + int newCount = 0; + + foreach (var itemIndex in s_compListPageHandler) + { + newCount++; + + // normalized index starting from 0 + var i = itemIndex - s_compListPageHandler.StartIndex; + + if (itemIndex >= components.Length) + { + if (i > s_lastCompCount || i >= s_compListTexts.Count) + break; + + GameObject label = s_compListTexts[i].transform.parent.parent.gameObject; + if (label.activeSelf) + label.SetActive(false); + } + else + { + Component comp = components[itemIndex]; + + if (!comp) + continue; + + if (i >= s_compShortlist.Count) + { + s_compShortlist.Add(comp); + AddCompListButton(); + } + else + { + s_compShortlist[i] = comp; + } + + var text = s_compListTexts[i]; + + text.text = ReflectionHelpers.GetActualType(comp).FullName; + + var toggle = s_compToggles[i]; + if (comp is Behaviour behaviour) + { + if (!toggle.gameObject.activeSelf) + toggle.gameObject.SetActive(true); + + toggle.isOn = behaviour.enabled; + } + else + { + if (toggle.gameObject.activeSelf) + toggle.gameObject.SetActive(false); + } + + var label = text.transform.parent.parent.gameObject; + if (!label.activeSelf) + { + label.SetActive(true); + } + } + } + + s_lastCompCount = newCount; } private void ChangeInspectorTarget(GameObject newTarget) @@ -56,71 +302,223 @@ namespace ExplorerBeta.UI.Main.Inspectors return; this.Target = this.TargetGO = newTarget; - - // ? } + private static void ApplyNameClicked() + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.TargetGO.name = m_nameInput.text; + } + + private static void OnEnableToggled(bool enabled) + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.TargetGO.SetActive(enabled); + } + + private static void OnLayerSelected(int layer) + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.TargetGO.layer = layer; + } + + private static void OnCompToggleClicked(int index, bool value) + { + var comp = s_compShortlist[index]; + + (comp as Behaviour).enabled = value; + } + + #region CHILD LIST + + private static void OnChildListObjectClicked(int index) + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + if (index >= s_childrenShortlist.Count || !s_childrenShortlist[index]) + { + return; + } + + instance.ChangeInspectorTarget(s_childrenShortlist[index]); + + instance.Update(); + } + + private static void OnBackButtonClicked() + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.ChangeInspectorTarget(instance.TargetGO.transform.parent.gameObject); + } + + private static void OnChildListPageTurn() + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.RefreshChildObjectList(); + } + + #endregion + + #region COMPONENT LIST + + private static void OnCompListObjectClicked(int index) + { + if (index >= s_compShortlist.Count || !s_compShortlist[index]) + { + return; + } + + InspectorManager.Instance.Inspect(s_compShortlist[index]); + } + + private static void OnCompListPageTurn() + { + if (!(InspectorManager.Instance.m_activeInspector is GameObjectInspector instance)) return; + + instance.RefreshComponentList(); + } + + #endregion + #region UI CONSTRUCTION private void ConstructUI() { var parent = InspectorManager.Instance.m_inspectorContent; - this.Content = UIFactory.CreateScrollView(parent, out GameObject scrollContent, new Color(0.1f, 0.1f, 0.1f, 1)); + m_content = UIFactory.CreateScrollView(parent, out GameObject scrollContent, new Color(0.1f, 0.1f, 0.1f)); - var scrollLayout = scrollContent.GetComponent(); - scrollLayout.childForceExpandHeight = false; - scrollLayout.childControlHeight = true; - scrollLayout.spacing = 5; + var scrollGroup = scrollContent.GetComponent(); + scrollGroup.childForceExpandHeight = false; + scrollGroup.childControlHeight = true; + scrollGroup.spacing = 5; ConstructTopArea(scrollContent); - ConstructChildList(scrollContent); + var midGroupObj = UIFactory.CreateHorizontalGroup(scrollContent, new Color(1,1,1,0)); + var midGroup = midGroupObj.GetComponent(); + midGroup.spacing = 5; + midGroup.childForceExpandWidth = true; + midGroup.childControlWidth = true; + var midlayout = midGroupObj.AddComponent(); + midlayout.minHeight = 40; + midlayout.flexibleHeight = 10000; + midlayout.flexibleWidth = 25000; + midlayout.minWidth = 200; - ConstructCompList(scrollContent); + ConstructChildList(midGroupObj); + ConstructCompList(midGroupObj); ConstructControls(scrollContent); } private void ConstructTopArea(GameObject scrollContent) { + // path row + + m_pathGroupObj = UIFactory.CreateHorizontalGroup(scrollContent, new Color(0.1f, 0.1f, 0.1f)); + var pathGroup = m_pathGroupObj.GetComponent(); + pathGroup.childForceExpandHeight = false; + pathGroup.childForceExpandWidth = false; + pathGroup.childControlHeight = false; + pathGroup.childControlWidth = true; + pathGroup.spacing = 5; + var pathRect = m_pathGroupObj.GetComponent(); + pathRect.sizeDelta = new Vector2(pathRect.sizeDelta.x, 20); + var pathLayout = m_pathGroupObj.AddComponent(); + pathLayout.minHeight = 20; + pathLayout.flexibleHeight = 75; + + var backButtonObj = UIFactory.CreateButton(m_pathGroupObj); + var backButton = backButtonObj.GetComponent