├── .gitignore ├── Assets ├── Yurowm.meta └── Yurowm │ ├── DebugConsole.meta │ ├── DebugConsole │ ├── DebugConsole.cs │ ├── DebugConsole.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── DebugConsoleView.cs │ │ └── DebugConsoleView.cs.meta │ ├── ExampleCommands.cs │ ├── ExampleCommands.cs.meta │ ├── ICommand.cs │ ├── ICommand.cs.meta │ ├── Resources.meta │ └── Resources │ │ ├── DebugConsole.prefab │ │ └── DebugConsole.prefab.meta │ ├── DebugPanel.meta │ ├── DebugPanel │ ├── DebugPanel.cs │ ├── DebugPanel.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── DebugPanelView.cs │ │ └── DebugPanelView.cs.meta │ ├── Resources.meta │ └── Resources │ │ ├── ButtonItem.prefab │ │ ├── ButtonItem.prefab.meta │ │ ├── CategoryItem.prefab │ │ ├── CategoryItem.prefab.meta │ │ ├── DebugPanel.prefab │ │ ├── DebugPanel.prefab.meta │ │ ├── TextItem.prefab │ │ └── TextItem.prefab.meta │ ├── Test.meta │ └── Test │ ├── Test.cs │ ├── Test.cs.meta │ ├── Test.unity │ └── Test.unity.meta ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── Release └── DebugPanel.unitypackage /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]ackup/ 6 | /[Bb]uilds/ 7 | /[Ss]creenshots/ 8 | 9 | 10 | # Autogenerated VS/MD solution and project files 11 | /*.csproj 12 | /*.sln 13 | *.unityproj 14 | *.suo 15 | *.tmp 16 | *.user 17 | *.userprefs 18 | *.pidb 19 | *.booproj 20 | *.vs 21 | 22 | # Unity3D generated meta files 23 | *.pidb.meta 24 | 25 | # Unity3D Generated File On Crash Reports 26 | sysinfo.txt 27 | -------------------------------------------------------------------------------- /Assets/Yurowm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ceeec9333170b3844b782bb4bc8c3d05 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1414583fe2ef8534db2c258347e4934e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/DebugConsole.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Text; 4 | using UnityEngine; 5 | using UnityEngine.EventSystems; 6 | using UnityEngine.UI; 7 | 8 | namespace Yurowm.DebugTools { 9 | public class DebugConsole : MonoBehaviour { 10 | static DebugConsole _Instance = null; 11 | public static DebugConsole Instance { 12 | get { 13 | if (!_Instance && Application.isPlaying) { 14 | _Instance = FindObjectOfType(); 15 | if (!_Instance) { 16 | _Instance = Resources.Load("DebugConsole"); 17 | if (_Instance) { 18 | _Instance = Instantiate(_Instance.gameObject).GetComponent(); 19 | _Instance.transform.localPosition = Vector3.zero; 20 | _Instance.transform.localRotation = Quaternion.identity; 21 | _Instance.transform.localScale = Vector3.one; 22 | _Instance.gameObject.SetActive(false); 23 | _Instance.gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave; 24 | _Instance.name = "DebugConsole"; 25 | } 26 | } 27 | } 28 | return _Instance; 29 | } 30 | } 31 | 32 | static DebugConsoleUpdater _Updater = null; 33 | static DebugConsoleUpdater Updater { 34 | get { 35 | if (!_Updater && Application.isPlaying) { 36 | _Updater = FindObjectOfType(); 37 | if (!_Updater) { 38 | _Updater = new GameObject("DebugConsoleUpdater") 39 | .AddComponent(); 40 | _Updater.gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave; 41 | } 42 | } 43 | return _Updater; 44 | } 45 | } 46 | 47 | public StringBuilder builder = new StringBuilder(); 48 | 49 | public Text output; 50 | public InputField input; 51 | public Button enter; 52 | public Button cancel; 53 | 54 | [RuntimeInitializeOnLoadMethod] 55 | public static void InitializeOnLoad() { 56 | DebugPanel.AddDelegate("Debug Console", () => { 57 | DebugPanel.Instance.lockButton.onClick.Invoke(); 58 | Instance.gameObject.SetActive(true); 59 | }); 60 | } 61 | 62 | void Awake() { 63 | if (!_Instance) _Instance = this; 64 | 65 | enter.onClick.AddListener(OnSubmit); 66 | cancel.onClick.AddListener(OnCancel); 67 | output.text = ""; 68 | input.text = ""; 69 | } 70 | 71 | void OnEnable() { 72 | enter.gameObject.SetActive(true); 73 | cancel.gameObject.SetActive(false); 74 | cancelRequest = false; 75 | 76 | StopAllCoroutines(); 77 | Hello(); 78 | } 79 | 80 | public void Hello() { 81 | WriteLine(ColorizeText("Write 'help' to see the command list.", Color.gray)); 82 | WriteLine(ColorizeText("Write 'hide' to close the console.", Color.gray)); 83 | } 84 | 85 | bool wasFocused = false; 86 | void Update() { 87 | if (wasFocused && Input.GetKeyDown(KeyCode.Return)) 88 | OnSubmit(); 89 | wasFocused = input.isFocused; 90 | } 91 | 92 | public void OnSubmit() { 93 | string command = input.text; 94 | input.text = ""; 95 | input.Select(); 96 | input.ActivateInputField(); 97 | OnSubmit(command); 98 | } 99 | 100 | public void OnSubmit(string command) { 101 | command = command.Trim(); 102 | if (string.IsNullOrEmpty(command)) 103 | return; 104 | WriteLine("> " + command + ""); 105 | Updater.StartCoroutine(Execute(command)); 106 | } 107 | 108 | bool cancelRequest = false; 109 | void OnCancel() { 110 | cancelRequest = true; 111 | } 112 | 113 | IEnumerator Execute(string command) { 114 | enter.gameObject.SetActive(false); 115 | cancel.gameObject.SetActive(true); 116 | 117 | cancelRequest = false; 118 | 119 | var logic = Commands.Execute(command, WriteLine); 120 | 121 | while (logic.MoveNext() && !cancelRequest) 122 | yield return logic.Current; 123 | 124 | cancelRequest = false; 125 | 126 | enter.gameObject.SetActive(true); 127 | cancel.gameObject.SetActive(false); 128 | } 129 | 130 | public void WriteLine(string command) { 131 | builder.AppendLine(command); 132 | output.text = builder.ToString().Trim(); 133 | } 134 | 135 | public static string Error(string text) { 136 | return ColorizeText(text, Color.red, false, true); 137 | } 138 | 139 | public static string Success(string text) { 140 | return ColorizeText(text, Color.green, true); 141 | } 142 | 143 | public static string Alias(string text) { 144 | return ColorizeText(text, Color.cyan); 145 | } 146 | 147 | public static string Warning(string text) { 148 | return ColorizeText(text, Color.yellow, false, true); 149 | } 150 | 151 | public static string ColorizeText(string text, Color? color = null, bool bold = false, bool italic = false) { 152 | StringBuilder builder = new StringBuilder(); 153 | if (color.HasValue) 154 | builder.Append(string.Format("", 155 | (byte) (255 * color.Value.r), 156 | (byte) (255 * color.Value.g), 157 | (byte) (255 * color.Value.b), 158 | (byte) (255 * color.Value.a))); 159 | if (bold) builder.Append(""); 160 | if (italic) builder.Append(""); 161 | 162 | builder.Append(text); 163 | 164 | if (italic) builder.Append(""); 165 | if (bold) builder.Append(""); 166 | if (color.HasValue) builder.Append(""); 167 | 168 | return builder.ToString(); 169 | } 170 | } 171 | 172 | class DebugConsoleUpdater : MonoBehaviour { 173 | 174 | } 175 | } -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/DebugConsole.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1f3e1f04693ed04986a3a3f8f00fc9b 3 | timeCreated: 1522988302 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 44ea6ff434ee7cc4ba4fa2d690748a74 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Editor/DebugConsoleView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using UnityEditor; 7 | using UnityEngine; 8 | 9 | namespace Yurowm.DebugTools { 10 | public class DebugConsoleView : EditorWindow { 11 | static DebugConsoleView instance = null; 12 | 13 | [MenuItem("Window/DebugTools/Debug Console")] 14 | public static DebugConsoleView CreateBerryPanel() { 15 | DebugConsoleView window; 16 | if (instance == null) { 17 | window = GetWindow(); 18 | window.Show(); 19 | window.OnEnable(); 20 | } else { 21 | window = instance; 22 | window.Show(); 23 | } 24 | return window; 25 | } 26 | 27 | void OnEnable() { 28 | instance = this; 29 | blackTexture = null; 30 | titleContent.text = "Debug Console"; 31 | } 32 | 33 | GUIStyle outputStyle = null; 34 | GUIStyle outputBackgroundStyle = null; 35 | Texture2D blackTexture = null; 36 | 37 | void InitializeStyles() { 38 | blackTexture = new Texture2D(1, 1); 39 | blackTexture.SetPixel(0, 0, Color.black); 40 | blackTexture.Apply(); 41 | 42 | outputStyle = new GUIStyle(EditorStyles.label); 43 | outputStyle.normal.textColor = Color.white; 44 | outputStyle.richText = true; 45 | outputStyle.wordWrap = true; 46 | outputStyle.alignment = TextAnchor.LowerLeft; 47 | outputStyle.clipping = TextClipping.Clip; 48 | outputStyle.hover = outputStyle.normal; 49 | outputStyle.active = outputStyle.normal; 50 | outputStyle.focused = outputStyle.normal; 51 | outputStyle.fontSize = 14; 52 | 53 | outputBackgroundStyle = new GUIStyle(EditorStyles.textArea); 54 | outputBackgroundStyle.normal.background = blackTexture; 55 | outputBackgroundStyle.border = new RectOffset(); 56 | outputBackgroundStyle.margin = new RectOffset(); 57 | outputBackgroundStyle.padding = new RectOffset(); 58 | } 59 | 60 | string offlineOutput = DebugConsole.Warning("The console works only in Play mode."); 61 | const string controlName = "Command Line"; 62 | Vector2 scrollPosition = new Vector2(); 63 | List commandsHistory = new List(); 64 | int commandsHistoryIndex = 0; 65 | string command = ""; 66 | bool updateInput = false; 67 | void OnGUI() { 68 | if (blackTexture == null) 69 | InitializeStyles(); 70 | 71 | EditorGUILayout.BeginVertical(outputBackgroundStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 72 | scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 73 | 74 | GUILayout.TextArea(EditorApplication.isPlaying ? 75 | DebugConsole.Instance.output.text : offlineOutput, 76 | outputStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 77 | 78 | EditorGUILayout.EndScrollView(); 79 | 80 | if (EditorApplication.isPlaying) { 81 | GUI.SetNextControlName(controlName); 82 | if (updateInput) { 83 | UpdateInput(); 84 | updateInput = false; 85 | } 86 | command = EditorGUILayout.TextField(command, GUILayout.ExpandWidth(true)); 87 | GUI.SetNextControlName(""); 88 | 89 | if (GUI.GetNameOfFocusedControl() == controlName) { 90 | EditorGUI.FocusTextInControl(controlName); 91 | if (Event.current.keyCode == KeyCode.Return) { 92 | command = command.Trim(); 93 | if (!string.IsNullOrEmpty(command)) { 94 | try { 95 | DebugConsole.Instance.OnSubmit(command); 96 | if (commandsHistory.Count == 0 || command != commandsHistory.Last()) { 97 | commandsHistory.Add(command); 98 | commandsHistoryIndex = commandsHistory.Count; 99 | } 100 | } catch (Exception e) { 101 | DebugConsole.Instance.WriteLine(DebugConsole.Error(e.ToString())); 102 | } 103 | scrollPosition = new Vector2(0, float.MaxValue); 104 | command = ""; 105 | updateInput = true; 106 | Repaint(); 107 | } 108 | } 109 | else if(Event.current.type == EventType.KeyUp) { 110 | if (Event.current.keyCode == KeyCode.DownArrow) { 111 | if (commandsHistory.Count > 0) { 112 | commandsHistoryIndex++; 113 | commandsHistoryIndex = Mathf.Min(commandsHistoryIndex, commandsHistory.Count - 1); 114 | command = commandsHistory[commandsHistoryIndex]; 115 | updateInput = true; 116 | Repaint(); 117 | } 118 | } else if (Event.current.keyCode == KeyCode.UpArrow) { 119 | if (commandsHistory.Count > 0) { 120 | commandsHistoryIndex--; 121 | commandsHistoryIndex = Mathf.Max(commandsHistoryIndex, 0); 122 | command = commandsHistory[commandsHistoryIndex]; 123 | updateInput = true; 124 | Repaint(); 125 | } 126 | } 127 | } 128 | EditorGUI.FocusTextInControl(controlName); 129 | } 130 | } 131 | EditorGUILayout.EndVertical(); 132 | Repaint(); 133 | } 134 | 135 | FieldInfo textEditorProvider = null; 136 | void UpdateInput() { 137 | 138 | if (textEditorProvider == null) 139 | textEditorProvider = typeof(EditorGUI) 140 | .GetField("activeEditor", BindingFlags.Static | BindingFlags.NonPublic); 141 | 142 | TextEditor textEditor = textEditorProvider.GetValue(null) as TextEditor; 143 | 144 | if (textEditor == null) 145 | return; 146 | 147 | //textEditor.text = command; 148 | textEditor.SelectAll(); 149 | textEditor.Delete(); 150 | textEditor.ReplaceSelection(command); 151 | textEditor.SelectTextEnd(); 152 | } 153 | } 154 | } -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Editor/DebugConsoleView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0894679369238b4b8fc55d4913aa714 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/ExampleCommands.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using UnityEngine; 8 | using UnityEngine.SceneManagement; 9 | 10 | namespace Yurowm.DebugTools { 11 | public class HelloWorld : ICommand { 12 | public override IEnumerator Execute(params string[] args) { 13 | yield return "Hello buddy! :)"; 14 | foreach (string arg in args) { 15 | yield return arg; 16 | yield return new WaitForSeconds(1f); 17 | } 18 | } 19 | 20 | public override string GetName() { 21 | return "hello"; 22 | } 23 | } 24 | 25 | public class SceneResearch : ICommand { 26 | 27 | Dictionary> sublogics; 28 | 29 | public SceneResearch() { 30 | sublogics = new Dictionary>(); 31 | sublogics.Add("list", ListOfChilds); 32 | sublogics.Add("select", SelectChild); 33 | sublogics.Add("details", PrintDetails); 34 | sublogics.Add("destroy", DestroySelected); 35 | } 36 | 37 | public override string Help() { 38 | StringBuilder builder = new StringBuilder(); 39 | string format = GetName() + " {0} - {1}"; 40 | builder.AppendLine(string.Format(format, "list", "show list of child objects")); 41 | builder.AppendLine(string.Format(format, "select @3", "select third child object")); 42 | builder.AppendLine(string.Format(format, "select @root", "select root of the scene")); 43 | builder.AppendLine(string.Format(format, "select @parent", "select parent object")); 44 | builder.AppendLine(string.Format(format, "select ABC", "select child object with ABC name")); 45 | builder.AppendLine(string.Format(format, "details", "show details of selected object")); 46 | builder.AppendLine(string.Format(format, "destroy", "destroy selected object")); 47 | return builder.ToString(); 48 | } 49 | 50 | public override IEnumerator Execute(params string[] args) { 51 | IEnumerator sublogic = null; 52 | 53 | if (args.Length > 0 && sublogics.ContainsKey(args[0])) 54 | sublogic = sublogics[args[0]](args.Skip(1).ToArray()); 55 | 56 | if (sublogic == null) 57 | sublogic = sublogics["help"](args.Skip(1).ToArray()); 58 | 59 | while (sublogic.MoveNext()) 60 | yield return sublogic.Current; 61 | } 62 | 63 | GameObject currentObject = null; 64 | IEnumerator ListOfChilds(params string[] args) { 65 | yield return DebugConsole.ColorizeText(string.Format("Childs of {0}", currentObject ? currentObject.name : "@Root"), Color.green, true); 66 | 67 | var childs = Childs(currentObject); 68 | if (childs.Length == 0) 69 | yield return "None..."; 70 | else { 71 | for (int i = 0; i < childs.Length; i++) 72 | yield return i + ". " + childs[i].name; 73 | } 74 | } 75 | 76 | IEnumerator DestroySelected(params string[] args) { 77 | if (currentObject) { 78 | Transform parent = currentObject.transform.parent; 79 | MonoBehaviour.Destroy(currentObject); 80 | yield return DebugConsole.Success(currentObject.name + " is removed"); 81 | currentObject = parent ? parent.gameObject : null; 82 | yield return DebugConsole.Success((currentObject ? currentObject.name : "@Root") + " is selected"); 83 | } else 84 | yield return DebugConsole.Error("@Root can't be removed"); 85 | } 86 | 87 | IEnumerator SelectChild(params string[] args) { 88 | if (args.Length == 0) { 89 | yield return DebugConsole.Error( 90 | "scene select @1 - to select a child with index # 1" 91 | + "\nscene select @root - to select the root" 92 | + "\nscene select @parent - to select a parent" 93 | + "\nscene select ABC - to select a child with ABC name"); 94 | yield break; 95 | } 96 | 97 | foreach (var arg in args) { 98 | var childs = Childs(currentObject); 99 | 100 | if (childs.Length == 0) { 101 | yield return DebugConsole.Error("Current object doesn't have any childs"); 102 | yield break; 103 | } 104 | 105 | if (arg.StartsWith("@")) { 106 | string substring = arg.Substring(1).ToLower(); 107 | switch (substring) { 108 | case "root": { 109 | currentObject = null; 110 | yield return DebugConsole.Success((currentObject ? currentObject.name : "@Root") + " is selected"); 111 | } break; 112 | case "parent": { 113 | if (currentObject && currentObject.transform.parent) { 114 | currentObject = currentObject.transform.parent.gameObject; 115 | yield return DebugConsole.Success((currentObject ? currentObject.name : "@Root") + " is selected"); 116 | } else { 117 | yield return DebugConsole.Error("@Root is already selected"); 118 | yield break; 119 | } 120 | } break; 121 | default: { 122 | int index = -1; 123 | if (int.TryParse(substring, out index)) { 124 | if (index >= 0 && index < childs.Length) { 125 | currentObject = childs[index].gameObject; 126 | yield return DebugConsole.Success(currentObject.name + " is selected"); 127 | } else { 128 | yield return DebugConsole.Error("Out or range!"); 129 | yield break; 130 | } 131 | } else { 132 | yield return DebugConsole.Error("Wrong format!"); 133 | yield break; 134 | } 135 | } break; 136 | } 137 | } else { 138 | string name = arg; 139 | GameObject newChild = childs.FirstOrDefault(c => c.name == name); 140 | 141 | if (newChild) { 142 | currentObject = newChild; 143 | yield return DebugConsole.Success(currentObject.name + " is selected"); 144 | } else { 145 | yield return DebugConsole.Error("The child is not found"); 146 | yield break; 147 | } 148 | } 149 | } 150 | } 151 | 152 | IEnumerator PrintDetails(params string[] args) { 153 | if (currentObject == null) 154 | yield return DebugConsole.Error("Can't show details of @Root"); 155 | else { 156 | yield return DebugConsole.Success("Details of " + currentObject.name); 157 | Type type; 158 | var components = currentObject.GetComponents(); 159 | List lines = new List(); 160 | foreach (var component in components) { 161 | type = component.GetType(); 162 | yield return DebugConsole.Alias(type.Name); 163 | foreach (FieldInfo info in type.GetFields()) { 164 | var value = info.GetValue(component); 165 | lines.Add(" " + info.Name + ": " + (value == null ? "null" : value.ToString())); 166 | } 167 | foreach (PropertyInfo info in type.GetProperties()) { 168 | if (info.GetIndexParameters().Length == 0) 169 | try { 170 | var value = info.GetValue(component, new object[0]); 171 | lines.Add(" " + info.Name + ": " + (value == null ? "null" : value.ToString())); 172 | } catch (Exception) {} 173 | } 174 | yield return string.Join("\n", lines.ToArray()); 175 | lines.Clear(); 176 | } 177 | } 178 | } 179 | 180 | GameObject[] Childs(GameObject gameObject) { 181 | if (gameObject == null) 182 | return SceneManager.GetActiveScene().GetRootGameObjects(); 183 | else { 184 | Transform transform = gameObject.transform; 185 | GameObject[] result = new GameObject[transform.childCount]; 186 | for (int i = 0; i < transform.childCount; i++) 187 | result[i] = transform.GetChild(i).gameObject; 188 | return result; 189 | } 190 | } 191 | 192 | public override string GetName() { 193 | return "scene"; 194 | } 195 | } 196 | 197 | public class SetCommands : ICommand { 198 | 199 | Dictionary> sublogics; 200 | 201 | Vector2Int defaultResolution; 202 | 203 | public override string Help() { 204 | StringBuilder builder = new StringBuilder(); 205 | string format = GetName() + " {0} - {1}"; 206 | builder.AppendLine(string.Format(format, "resolution default", "change screen resolution to default")); 207 | builder.AppendLine(string.Format(format, "resolution 480 600", "change screen resolution to 480x600")); 208 | builder.AppendLine(string.Format(format, "framerate default", "change target FPS to default (60)")); 209 | builder.AppendLine(string.Format(format, "framerate 20", "change target FPS to 20")); 210 | return builder.ToString(); 211 | } 212 | 213 | public SetCommands() { 214 | sublogics = new Dictionary>(); 215 | sublogics.Add("resolution", SetResolution); 216 | sublogics.Add("framerate", SetFramerate); 217 | defaultResolution = new Vector2Int(Screen.width, Screen.height); 218 | } 219 | 220 | public override IEnumerator Execute(params string[] args) { 221 | IEnumerator sublogic = null; 222 | 223 | if (args.Length > 0 && sublogics.ContainsKey(args[0])) 224 | sublogic = sublogics[args[0]](args.Skip(1).ToArray()); 225 | 226 | if (sublogic != null) 227 | while (sublogic.MoveNext()) 228 | yield return sublogic.Current; 229 | } 230 | 231 | IEnumerator SetResolution(params string[] args) { 232 | if (args.Length > 0 && args[0] == "default") { 233 | Screen.SetResolution(defaultResolution.x, defaultResolution.y, true); 234 | yield return DebugConsole.Success(string.Format("Resolution is set to {0}x{1}", defaultResolution.x, defaultResolution.y)); 235 | } 236 | 237 | if (args.Length != 2) { 238 | yield return DebugConsole.Error("set resolution 480 600 (example)"); 239 | yield break; 240 | } 241 | 242 | int width; 243 | int height; 244 | 245 | if (int.TryParse(args[0], out width) && int.TryParse(args[1], out height)) { 246 | Screen.SetResolution(width, height, true); 247 | yield return DebugConsole.Success(string.Format("Resolution is set to {0}x{1}", width, height)); 248 | } else 249 | yield return DebugConsole.Error("Error of parsing. Use only integer values."); 250 | } 251 | 252 | IEnumerator SetFramerate(params string[] args) { 253 | if (args.Length > 0 && args[0] == "default") { 254 | Application.targetFrameRate = 60; 255 | yield return DebugConsole.Success(string.Format("Frame rate is set to {0}", Application.targetFrameRate)); 256 | } 257 | 258 | if (args.Length != 1) { 259 | yield return DebugConsole.Error("set framerate 30 (example)"); 260 | yield break; 261 | } 262 | 263 | int target; 264 | 265 | if (int.TryParse(args[0], out target)) { 266 | Application.targetFrameRate = target; 267 | yield return DebugConsole.Success(string.Format("Frame rate is set to {0}", Application.targetFrameRate)); 268 | } else 269 | yield return DebugConsole.Error("Error of parsing. Use only integer values."); 270 | } 271 | 272 | public override string GetName() { 273 | return "set"; 274 | } 275 | } 276 | } -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/ExampleCommands.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1026db2d6bf92ea46bcb00b7b2d01f40 3 | timeCreated: 1522992558 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/ICommand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Text.RegularExpressions; 8 | using UnityEngine; 9 | 10 | namespace Yurowm.DebugTools { 11 | public abstract class ICommand { 12 | public abstract string GetName(); 13 | public abstract IEnumerator Execute(params string[] args); 14 | public virtual string Help() { 15 | return null; 16 | } 17 | } 18 | 19 | [AttributeUsage(AttributeTargets.Method)] 20 | public class QuickCommand : Attribute { 21 | MethodInfo method = null; 22 | Regex regex; 23 | string commandBody; 24 | string parametersExample; 25 | string description; 26 | 27 | static readonly Regex scapeReplaceRegex = new Regex(@"\s+"); 28 | 29 | public QuickCommand(string commandBody, string parametersExample = null, string description = null) { 30 | commandBody = scapeReplaceRegex.Replace(commandBody.Trim(), " "); 31 | this.commandBody = commandBody; 32 | this.parametersExample = parametersExample; 33 | this.description = description; 34 | } 35 | 36 | public void SetMethod(MethodInfo method) { 37 | this.method = method; 38 | int index = -1; 39 | string expression = commandBody; 40 | foreach (var parameter in method.GetParameters()) { 41 | index++; 42 | if (parameter.ParameterType == typeof(string)) 43 | expression += " (?\S+)"; 44 | else if (parameter.ParameterType == typeof(int)) 45 | expression += " (?\d+)"; 46 | else if (parameter.ParameterType == typeof(float)) 47 | expression += " (?[\d\.\,]+)"; 48 | else 49 | throw new Exception(method.Name + " has parameters with unsupported types. You can use only int, float and string."); 50 | } 51 | 52 | regex = new Regex(expression); 53 | } 54 | 55 | public bool TryExecute(string command, out IEnumerator logic) { 56 | Match match = regex.Match(command); 57 | Group group = null; 58 | if (regex.IsMatch(command)) { 59 | #region Extruct Parameters 60 | List parameters = new List(); 61 | foreach (var parameter in method.GetParameters()) { 62 | group = match.Groups["arg" + parameters.Count]; 63 | 64 | if (parameter.ParameterType == typeof(string)) 65 | parameters.Add(group.Value); 66 | 67 | else if(parameter.ParameterType == typeof (int)) 68 | parameters.Add(int.Parse(group.Value)); 69 | 70 | else if (parameter.ParameterType == typeof(float)) 71 | parameters.Add(float.Parse(group.Value)); 72 | } 73 | #endregion 74 | if (method.ReturnType == typeof(IEnumerator)) 75 | logic = method.Invoke(null, parameters.ToArray()) as IEnumerator; 76 | else if (method.ReturnType == typeof(string)) 77 | logic = Execute(() => (string) method.Invoke(null, parameters.ToArray())); 78 | else 79 | logic = Execute(() => method.Invoke(null, parameters.ToArray())); 80 | return true; 81 | } 82 | logic = null; 83 | return false; 84 | } 85 | 86 | IEnumerator Error(string text) { 87 | yield return DebugConsole.Error(text); 88 | } 89 | 90 | IEnumerator Execute(Action action) { 91 | action.Invoke(); 92 | yield break; 93 | } 94 | 95 | IEnumerator Execute(Func func) { 96 | yield return func.Invoke(); 97 | } 98 | 99 | public string Help() { 100 | return description == null ? null : 101 | commandBody + (string.IsNullOrEmpty(parametersExample) ? "" : " " + parametersExample) + " - " + description; 102 | } 103 | } 104 | 105 | public static class Commands { 106 | public readonly static Dictionary commands; 107 | public readonly static List quickCommands; 108 | static Commands() { 109 | commands = new Dictionary(); 110 | Type reference = typeof(ICommand); 111 | foreach (Type type in reference.FindInheritorTypes()) { 112 | ICommand command = (ICommand) Activator.CreateInstance(type); 113 | commands[command.GetName().ToLower()] = command; 114 | } 115 | quickCommands = new List(); 116 | foreach (MethodInfo method in reference.Assembly.GetTypes() 117 | .SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public)) 118 | .Where(m => m.GetCustomAttributes(true).Any(a => a is QuickCommand))) { 119 | QuickCommand command = method.GetCustomAttributes(true).First(a => a is QuickCommand) as QuickCommand; 120 | command.SetMethod(method); 121 | quickCommands.Add(command); 122 | } 123 | } 124 | 125 | readonly static Regex wordSplitter = new Regex(@"\s+"); 126 | public static IEnumerator Execute(string command, Action output) { 127 | string[] words = wordSplitter.Split(command); 128 | if (words.Length > 0) { 129 | IEnumerator logic = null; 130 | if (commands.ContainsKey(words[0].ToLower())) { 131 | ICommand c = commands[words[0].ToLower()]; 132 | logic = c.Execute(words.Skip(1).ToArray()); 133 | } else if (!quickCommands.Any(c => c.TryExecute(command, out logic))) { 134 | output.Invoke("This command is not found"); 135 | yield break; 136 | } 137 | 138 | Exception exception = null; 139 | 140 | while (true) { 141 | try { 142 | if (!logic.MoveNext()) 143 | break; 144 | } catch (Exception e) { 145 | exception = e; 146 | break; 147 | } 148 | 149 | if (logic.Current is string) output(logic.Current as string); 150 | yield return logic.Current; 151 | } 152 | 153 | if (exception != null) 154 | output(DebugConsole.Error(exception.ToString())); 155 | } 156 | } 157 | 158 | static List FindInheritorTypes(this Type type) { 159 | return type.Assembly.GetTypes().Where(x => type != x && type.IsAssignableFrom(x)).ToList(); 160 | } 161 | } 162 | 163 | public class ClearCommand : ICommand { 164 | public override IEnumerator Execute(params string[] args) { 165 | DebugConsole.Instance.builder = new System.Text.StringBuilder(); 166 | DebugConsole.Instance.output.text = ""; 167 | DebugConsole.Instance.Hello(); 168 | yield return null; 169 | } 170 | 171 | public override string GetName() { 172 | return "clear"; 173 | } 174 | 175 | public override string Help() { 176 | return GetName() + " - clear the console"; 177 | } 178 | } 179 | 180 | public class HideCommand : ICommand { 181 | public override IEnumerator Execute(params string[] args) { 182 | DebugConsole.Instance.gameObject.SetActive(false); 183 | yield return null; 184 | } 185 | 186 | public override string GetName() { 187 | return "hide"; 188 | } 189 | 190 | public override string Help() { 191 | return GetName() + " - close the console"; 192 | } 193 | } 194 | 195 | public class HelpCommand : ICommand { 196 | public override IEnumerator Execute(params string[] args) { 197 | StringBuilder builder = new StringBuilder(); 198 | List lines = new List(); 199 | foreach (string help in Commands.commands.Values 200 | .Select(c => c.Help()) 201 | .Where(h => !string.IsNullOrEmpty(h))) { 202 | lines.Add(help.Trim()); 203 | } 204 | foreach (string help in Commands.quickCommands 205 | .Select(c => c.Help()) 206 | .Where(h => !string.IsNullOrEmpty(h))) { 207 | lines.Add(help.Trim()); 208 | } 209 | lines.Sort(); 210 | for (int i = 0; i < lines.Count; i++) 211 | builder.AppendLine(lines[i]); 212 | yield return builder.ToString(); 213 | } 214 | 215 | public override string GetName() { 216 | return "help"; 217 | } 218 | 219 | public override string Help() { 220 | return GetName() + " - show the list of commands"; 221 | } 222 | } 223 | } 224 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/ICommand.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ca2830571345e34da06b6798252cf98 3 | timeCreated: 1522991729 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 728e595d51dbe8b47956b29c8eecdeb0 3 | folderAsset: yes 4 | timeCreated: 1522989744 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Resources/DebugConsole.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1390798660830614} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1034669198820538 15 | GameObject: 16 | m_ObjectHideFlags: 1 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 224499242075774682} 22 | - component: {fileID: 222551766854666022} 23 | - component: {fileID: 114885290307651388} 24 | m_Layer: 0 25 | m_Name: Input 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!1 &1039381711824346 32 | GameObject: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | serializedVersion: 5 37 | m_Component: 38 | - component: {fileID: 224626620451390332} 39 | - component: {fileID: 222328545949047970} 40 | - component: {fileID: 114128097878744328} 41 | - component: {fileID: 114673989187842768} 42 | - component: {fileID: 114566985521343212} 43 | m_Layer: 0 44 | m_Name: InputField 45 | m_TagString: Untagged 46 | m_Icon: {fileID: 0} 47 | m_NavMeshLayer: 0 48 | m_StaticEditorFlags: 0 49 | m_IsActive: 1 50 | --- !u!1 &1142309470677772 51 | GameObject: 52 | m_ObjectHideFlags: 1 53 | m_PrefabParentObject: {fileID: 0} 54 | m_PrefabInternal: {fileID: 100100000} 55 | serializedVersion: 5 56 | m_Component: 57 | - component: {fileID: 224815689957065318} 58 | - component: {fileID: 222648513230845526} 59 | - component: {fileID: 114105666445383936} 60 | m_Layer: 0 61 | m_Name: Text 62 | m_TagString: Untagged 63 | m_Icon: {fileID: 0} 64 | m_NavMeshLayer: 0 65 | m_StaticEditorFlags: 0 66 | m_IsActive: 1 67 | --- !u!1 &1144066272502726 68 | GameObject: 69 | m_ObjectHideFlags: 1 70 | m_PrefabParentObject: {fileID: 0} 71 | m_PrefabInternal: {fileID: 100100000} 72 | serializedVersion: 5 73 | m_Component: 74 | - component: {fileID: 224856670432556356} 75 | - component: {fileID: 114470980037217860} 76 | - component: {fileID: 222294455750674388} 77 | - component: {fileID: 114959810981306300} 78 | - component: {fileID: 114650198518640616} 79 | m_Layer: 0 80 | m_Name: Scroll 81 | m_TagString: Untagged 82 | m_Icon: {fileID: 0} 83 | m_NavMeshLayer: 0 84 | m_StaticEditorFlags: 0 85 | m_IsActive: 1 86 | --- !u!1 &1189937722084398 87 | GameObject: 88 | m_ObjectHideFlags: 1 89 | m_PrefabParentObject: {fileID: 0} 90 | m_PrefabInternal: {fileID: 100100000} 91 | serializedVersion: 5 92 | m_Component: 93 | - component: {fileID: 224594898992846504} 94 | - component: {fileID: 222845575662104756} 95 | - component: {fileID: 114777148721092576} 96 | - component: {fileID: 225342966786627282} 97 | m_Layer: 0 98 | m_Name: BG 99 | m_TagString: Untagged 100 | m_Icon: {fileID: 0} 101 | m_NavMeshLayer: 0 102 | m_StaticEditorFlags: 0 103 | m_IsActive: 1 104 | --- !u!1 &1214164961261658 105 | GameObject: 106 | m_ObjectHideFlags: 0 107 | m_PrefabParentObject: {fileID: 0} 108 | m_PrefabInternal: {fileID: 100100000} 109 | serializedVersion: 5 110 | m_Component: 111 | - component: {fileID: 224752089099485032} 112 | - component: {fileID: 223144819959694060} 113 | - component: {fileID: 114831913987979466} 114 | - component: {fileID: 114917037866404870} 115 | m_Layer: 0 116 | m_Name: Canvas 117 | m_TagString: Untagged 118 | m_Icon: {fileID: 0} 119 | m_NavMeshLayer: 0 120 | m_StaticEditorFlags: 0 121 | m_IsActive: 1 122 | --- !u!1 &1228869779680382 123 | GameObject: 124 | m_ObjectHideFlags: 1 125 | m_PrefabParentObject: {fileID: 0} 126 | m_PrefabInternal: {fileID: 100100000} 127 | serializedVersion: 5 128 | m_Component: 129 | - component: {fileID: 224267762115843528} 130 | - component: {fileID: 222103559350871666} 131 | - component: {fileID: 114488985644350786} 132 | m_Layer: 0 133 | m_Name: Console 134 | m_TagString: Untagged 135 | m_Icon: {fileID: 0} 136 | m_NavMeshLayer: 0 137 | m_StaticEditorFlags: 0 138 | m_IsActive: 1 139 | --- !u!1 &1306600296809728 140 | GameObject: 141 | m_ObjectHideFlags: 1 142 | m_PrefabParentObject: {fileID: 0} 143 | m_PrefabInternal: {fileID: 100100000} 144 | serializedVersion: 5 145 | m_Component: 146 | - component: {fileID: 224288975493165162} 147 | - component: {fileID: 222067853971939906} 148 | - component: {fileID: 114749364560048702} 149 | m_Layer: 0 150 | m_Name: Text 151 | m_TagString: Untagged 152 | m_Icon: {fileID: 0} 153 | m_NavMeshLayer: 0 154 | m_StaticEditorFlags: 0 155 | m_IsActive: 1 156 | --- !u!1 &1390798660830614 157 | GameObject: 158 | m_ObjectHideFlags: 0 159 | m_PrefabParentObject: {fileID: 0} 160 | m_PrefabInternal: {fileID: 100100000} 161 | serializedVersion: 5 162 | m_Component: 163 | - component: {fileID: 4426163278932142} 164 | - component: {fileID: 114876528512499110} 165 | m_Layer: 0 166 | m_Name: DebugConsole 167 | m_TagString: Untagged 168 | m_Icon: {fileID: 0} 169 | m_NavMeshLayer: 0 170 | m_StaticEditorFlags: 0 171 | m_IsActive: 1 172 | --- !u!1 &1478958097393808 173 | GameObject: 174 | m_ObjectHideFlags: 1 175 | m_PrefabParentObject: {fileID: 0} 176 | m_PrefabInternal: {fileID: 100100000} 177 | serializedVersion: 5 178 | m_Component: 179 | - component: {fileID: 224061364481137378} 180 | - component: {fileID: 222566617607703184} 181 | - component: {fileID: 114128211264325576} 182 | - component: {fileID: 114250581840642414} 183 | m_Layer: 0 184 | m_Name: Enter 185 | m_TagString: Untagged 186 | m_Icon: {fileID: 0} 187 | m_NavMeshLayer: 0 188 | m_StaticEditorFlags: 0 189 | m_IsActive: 1 190 | --- !u!1 &1521756874805372 191 | GameObject: 192 | m_ObjectHideFlags: 1 193 | m_PrefabParentObject: {fileID: 0} 194 | m_PrefabInternal: {fileID: 100100000} 195 | serializedVersion: 5 196 | m_Component: 197 | - component: {fileID: 224205846502228218} 198 | - component: {fileID: 222409435024748324} 199 | - component: {fileID: 114022473735688804} 200 | m_Layer: 0 201 | m_Name: Placeholder 202 | m_TagString: Untagged 203 | m_Icon: {fileID: 0} 204 | m_NavMeshLayer: 0 205 | m_StaticEditorFlags: 0 206 | m_IsActive: 1 207 | --- !u!1 &1687759447770254 208 | GameObject: 209 | m_ObjectHideFlags: 1 210 | m_PrefabParentObject: {fileID: 0} 211 | m_PrefabInternal: {fileID: 100100000} 212 | serializedVersion: 5 213 | m_Component: 214 | - component: {fileID: 224015628564908606} 215 | - component: {fileID: 222115443006781528} 216 | - component: {fileID: 114285554591366914} 217 | - component: {fileID: 114363751505445506} 218 | m_Layer: 0 219 | m_Name: Cancel 220 | m_TagString: Untagged 221 | m_Icon: {fileID: 0} 222 | m_NavMeshLayer: 0 223 | m_StaticEditorFlags: 0 224 | m_IsActive: 1 225 | --- !u!1 &1833153178863488 226 | GameObject: 227 | m_ObjectHideFlags: 1 228 | m_PrefabParentObject: {fileID: 0} 229 | m_PrefabInternal: {fileID: 100100000} 230 | serializedVersion: 5 231 | m_Component: 232 | - component: {fileID: 224615508052113150} 233 | - component: {fileID: 114188798113527020} 234 | - component: {fileID: 222829222803743182} 235 | - component: {fileID: 114543574800599530} 236 | m_Layer: 0 237 | m_Name: Output 238 | m_TagString: Untagged 239 | m_Icon: {fileID: 0} 240 | m_NavMeshLayer: 0 241 | m_StaticEditorFlags: 0 242 | m_IsActive: 1 243 | --- !u!4 &4426163278932142 244 | Transform: 245 | m_ObjectHideFlags: 1 246 | m_PrefabParentObject: {fileID: 0} 247 | m_PrefabInternal: {fileID: 100100000} 248 | m_GameObject: {fileID: 1390798660830614} 249 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 250 | m_LocalPosition: {x: 0, y: 0, z: 0} 251 | m_LocalScale: {x: 1, y: 1, z: 1} 252 | m_Children: 253 | - {fileID: 224752089099485032} 254 | m_Father: {fileID: 0} 255 | m_RootOrder: 0 256 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 257 | --- !u!114 &114022473735688804 258 | MonoBehaviour: 259 | m_ObjectHideFlags: 1 260 | m_PrefabParentObject: {fileID: 0} 261 | m_PrefabInternal: {fileID: 100100000} 262 | m_GameObject: {fileID: 1521756874805372} 263 | m_Enabled: 1 264 | m_EditorHideFlags: 0 265 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 266 | m_Name: 267 | m_EditorClassIdentifier: 268 | m_Material: {fileID: 0} 269 | m_Color: {r: 1, g: 1, b: 1, a: 0.303} 270 | m_RaycastTarget: 1 271 | m_OnCullStateChanged: 272 | m_PersistentCalls: 273 | m_Calls: [] 274 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 275 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 276 | m_FontData: 277 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 278 | m_FontSize: 14 279 | m_FontStyle: 0 280 | m_BestFit: 0 281 | m_MinSize: 10 282 | m_MaxSize: 40 283 | m_Alignment: 4 284 | m_AlignByGeometry: 0 285 | m_RichText: 0 286 | m_HorizontalOverflow: 1 287 | m_VerticalOverflow: 0 288 | m_LineSpacing: 1 289 | m_Text: Input line... 290 | --- !u!114 &114105666445383936 291 | MonoBehaviour: 292 | m_ObjectHideFlags: 1 293 | m_PrefabParentObject: {fileID: 0} 294 | m_PrefabInternal: {fileID: 100100000} 295 | m_GameObject: {fileID: 1142309470677772} 296 | m_Enabled: 1 297 | m_EditorHideFlags: 0 298 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 299 | m_Name: 300 | m_EditorClassIdentifier: 301 | m_Material: {fileID: 0} 302 | m_Color: {r: 1, g: 1, b: 1, a: 1} 303 | m_RaycastTarget: 1 304 | m_OnCullStateChanged: 305 | m_PersistentCalls: 306 | m_Calls: [] 307 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 308 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 309 | m_FontData: 310 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 311 | m_FontSize: 30 312 | m_FontStyle: 0 313 | m_BestFit: 0 314 | m_MinSize: 3 315 | m_MaxSize: 40 316 | m_Alignment: 4 317 | m_AlignByGeometry: 0 318 | m_RichText: 1 319 | m_HorizontalOverflow: 0 320 | m_VerticalOverflow: 0 321 | m_LineSpacing: 1 322 | m_Text: X 323 | --- !u!114 &114128097878744328 324 | MonoBehaviour: 325 | m_ObjectHideFlags: 1 326 | m_PrefabParentObject: {fileID: 0} 327 | m_PrefabInternal: {fileID: 100100000} 328 | m_GameObject: {fileID: 1039381711824346} 329 | m_Enabled: 1 330 | m_EditorHideFlags: 0 331 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 332 | m_Name: 333 | m_EditorClassIdentifier: 334 | m_Material: {fileID: 0} 335 | m_Color: {r: 0, g: 0, b: 0, a: 0.78431374} 336 | m_RaycastTarget: 1 337 | m_OnCullStateChanged: 338 | m_PersistentCalls: 339 | m_Calls: [] 340 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 341 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 342 | m_Sprite: {fileID: 0} 343 | m_Type: 1 344 | m_PreserveAspect: 0 345 | m_FillCenter: 1 346 | m_FillMethod: 4 347 | m_FillAmount: 1 348 | m_FillClockwise: 1 349 | m_FillOrigin: 0 350 | --- !u!114 &114128211264325576 351 | MonoBehaviour: 352 | m_ObjectHideFlags: 1 353 | m_PrefabParentObject: {fileID: 0} 354 | m_PrefabInternal: {fileID: 100100000} 355 | m_GameObject: {fileID: 1478958097393808} 356 | m_Enabled: 1 357 | m_EditorHideFlags: 0 358 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 359 | m_Name: 360 | m_EditorClassIdentifier: 361 | m_Material: {fileID: 0} 362 | m_Color: {r: 1, g: 1, b: 1, a: 1} 363 | m_RaycastTarget: 1 364 | m_OnCullStateChanged: 365 | m_PersistentCalls: 366 | m_Calls: [] 367 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 368 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 369 | m_Sprite: {fileID: 0} 370 | m_Type: 1 371 | m_PreserveAspect: 0 372 | m_FillCenter: 1 373 | m_FillMethod: 4 374 | m_FillAmount: 1 375 | m_FillClockwise: 1 376 | m_FillOrigin: 0 377 | --- !u!114 &114188798113527020 378 | MonoBehaviour: 379 | m_ObjectHideFlags: 1 380 | m_PrefabParentObject: {fileID: 0} 381 | m_PrefabInternal: {fileID: 100100000} 382 | m_GameObject: {fileID: 1833153178863488} 383 | m_Enabled: 1 384 | m_EditorHideFlags: 0 385 | m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 386 | m_Name: 387 | m_EditorClassIdentifier: 388 | m_HorizontalFit: 0 389 | m_VerticalFit: 2 390 | --- !u!114 &114250581840642414 391 | MonoBehaviour: 392 | m_ObjectHideFlags: 1 393 | m_PrefabParentObject: {fileID: 0} 394 | m_PrefabInternal: {fileID: 100100000} 395 | m_GameObject: {fileID: 1478958097393808} 396 | m_Enabled: 1 397 | m_EditorHideFlags: 0 398 | m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} 399 | m_Name: 400 | m_EditorClassIdentifier: 401 | m_Navigation: 402 | m_Mode: 3 403 | m_SelectOnUp: {fileID: 0} 404 | m_SelectOnDown: {fileID: 0} 405 | m_SelectOnLeft: {fileID: 0} 406 | m_SelectOnRight: {fileID: 0} 407 | m_Transition: 1 408 | m_Colors: 409 | m_NormalColor: {r: 0.019607844, g: 0.8078432, b: 0, a: 1} 410 | m_HighlightedColor: {r: 0.654902, g: 1, b: 0, a: 1} 411 | m_PressedColor: {r: 0.9607844, g: 0.9607844, b: 0.9607844, a: 1} 412 | m_DisabledColor: {r: 0.8078432, g: 0, b: 0, a: 0.353} 413 | m_ColorMultiplier: 1 414 | m_FadeDuration: 0.1 415 | m_SpriteState: 416 | m_HighlightedSprite: {fileID: 0} 417 | m_PressedSprite: {fileID: 0} 418 | m_DisabledSprite: {fileID: 0} 419 | m_AnimationTriggers: 420 | m_NormalTrigger: Normal 421 | m_HighlightedTrigger: Highlighted 422 | m_PressedTrigger: Pressed 423 | m_DisabledTrigger: Disabled 424 | m_Interactable: 1 425 | m_TargetGraphic: {fileID: 114128211264325576} 426 | m_OnClick: 427 | m_PersistentCalls: 428 | m_Calls: [] 429 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 430 | Culture=neutral, PublicKeyToken=null 431 | --- !u!114 &114285554591366914 432 | MonoBehaviour: 433 | m_ObjectHideFlags: 1 434 | m_PrefabParentObject: {fileID: 0} 435 | m_PrefabInternal: {fileID: 100100000} 436 | m_GameObject: {fileID: 1687759447770254} 437 | m_Enabled: 1 438 | m_EditorHideFlags: 0 439 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 440 | m_Name: 441 | m_EditorClassIdentifier: 442 | m_Material: {fileID: 0} 443 | m_Color: {r: 1, g: 1, b: 1, a: 1} 444 | m_RaycastTarget: 1 445 | m_OnCullStateChanged: 446 | m_PersistentCalls: 447 | m_Calls: [] 448 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 449 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 450 | m_Sprite: {fileID: 0} 451 | m_Type: 1 452 | m_PreserveAspect: 0 453 | m_FillCenter: 1 454 | m_FillMethod: 4 455 | m_FillAmount: 1 456 | m_FillClockwise: 1 457 | m_FillOrigin: 0 458 | --- !u!114 &114363751505445506 459 | MonoBehaviour: 460 | m_ObjectHideFlags: 1 461 | m_PrefabParentObject: {fileID: 0} 462 | m_PrefabInternal: {fileID: 100100000} 463 | m_GameObject: {fileID: 1687759447770254} 464 | m_Enabled: 1 465 | m_EditorHideFlags: 0 466 | m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} 467 | m_Name: 468 | m_EditorClassIdentifier: 469 | m_Navigation: 470 | m_Mode: 3 471 | m_SelectOnUp: {fileID: 0} 472 | m_SelectOnDown: {fileID: 0} 473 | m_SelectOnLeft: {fileID: 0} 474 | m_SelectOnRight: {fileID: 0} 475 | m_Transition: 1 476 | m_Colors: 477 | m_NormalColor: {r: 0.8078432, g: 0.2841379, b: 0, a: 1} 478 | m_HighlightedColor: {r: 1, g: 0.72192836, b: 0, a: 1} 479 | m_PressedColor: {r: 0.9607844, g: 0.9607844, b: 0.9607844, a: 1} 480 | m_DisabledColor: {r: 0.8078432, g: 0, b: 0, a: 0.228} 481 | m_ColorMultiplier: 1 482 | m_FadeDuration: 0.1 483 | m_SpriteState: 484 | m_HighlightedSprite: {fileID: 0} 485 | m_PressedSprite: {fileID: 0} 486 | m_DisabledSprite: {fileID: 0} 487 | m_AnimationTriggers: 488 | m_NormalTrigger: Normal 489 | m_HighlightedTrigger: Highlighted 490 | m_PressedTrigger: Pressed 491 | m_DisabledTrigger: Disabled 492 | m_Interactable: 1 493 | m_TargetGraphic: {fileID: 114285554591366914} 494 | m_OnClick: 495 | m_PersistentCalls: 496 | m_Calls: [] 497 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 498 | Culture=neutral, PublicKeyToken=null 499 | --- !u!114 &114470980037217860 500 | MonoBehaviour: 501 | m_ObjectHideFlags: 1 502 | m_PrefabParentObject: {fileID: 0} 503 | m_PrefabInternal: {fileID: 100100000} 504 | m_GameObject: {fileID: 1144066272502726} 505 | m_Enabled: 1 506 | m_EditorHideFlags: 0 507 | m_Script: {fileID: 1367256648, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 508 | m_Name: 509 | m_EditorClassIdentifier: 510 | m_Content: {fileID: 224615508052113150} 511 | m_Horizontal: 0 512 | m_Vertical: 1 513 | m_MovementType: 1 514 | m_Elasticity: 0.1 515 | m_Inertia: 1 516 | m_DecelerationRate: 0.135 517 | m_ScrollSensitivity: 1 518 | m_Viewport: {fileID: 0} 519 | m_HorizontalScrollbar: {fileID: 0} 520 | m_VerticalScrollbar: {fileID: 0} 521 | m_HorizontalScrollbarVisibility: 0 522 | m_VerticalScrollbarVisibility: 0 523 | m_HorizontalScrollbarSpacing: 0 524 | m_VerticalScrollbarSpacing: 0 525 | m_OnValueChanged: 526 | m_PersistentCalls: 527 | m_Calls: [] 528 | m_TypeName: UnityEngine.UI.ScrollRect+ScrollRectEvent, UnityEngine.UI, Version=1.0.0.0, 529 | Culture=neutral, PublicKeyToken=null 530 | --- !u!114 &114488985644350786 531 | MonoBehaviour: 532 | m_ObjectHideFlags: 1 533 | m_PrefabParentObject: {fileID: 0} 534 | m_PrefabInternal: {fileID: 100100000} 535 | m_GameObject: {fileID: 1228869779680382} 536 | m_Enabled: 1 537 | m_EditorHideFlags: 0 538 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 539 | m_Name: 540 | m_EditorClassIdentifier: 541 | m_Material: {fileID: 0} 542 | m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} 543 | m_RaycastTarget: 1 544 | m_OnCullStateChanged: 545 | m_PersistentCalls: 546 | m_Calls: [] 547 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 548 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 549 | m_Sprite: {fileID: 0} 550 | m_Type: 0 551 | m_PreserveAspect: 0 552 | m_FillCenter: 1 553 | m_FillMethod: 4 554 | m_FillAmount: 1 555 | m_FillClockwise: 1 556 | m_FillOrigin: 0 557 | --- !u!114 &114543574800599530 558 | MonoBehaviour: 559 | m_ObjectHideFlags: 1 560 | m_PrefabParentObject: {fileID: 0} 561 | m_PrefabInternal: {fileID: 100100000} 562 | m_GameObject: {fileID: 1833153178863488} 563 | m_Enabled: 1 564 | m_EditorHideFlags: 0 565 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 566 | m_Name: 567 | m_EditorClassIdentifier: 568 | m_Material: {fileID: 0} 569 | m_Color: {r: 1, g: 1, b: 1, a: 1} 570 | m_RaycastTarget: 1 571 | m_OnCullStateChanged: 572 | m_PersistentCalls: 573 | m_Calls: [] 574 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 575 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 576 | m_FontData: 577 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 578 | m_FontSize: 14 579 | m_FontStyle: 0 580 | m_BestFit: 0 581 | m_MinSize: 10 582 | m_MaxSize: 40 583 | m_Alignment: 6 584 | m_AlignByGeometry: 0 585 | m_RichText: 1 586 | m_HorizontalOverflow: 0 587 | m_VerticalOverflow: 0 588 | m_LineSpacing: 1 589 | m_Text: Test 590 | --- !u!114 &114566985521343212 591 | MonoBehaviour: 592 | m_ObjectHideFlags: 1 593 | m_PrefabParentObject: {fileID: 0} 594 | m_PrefabInternal: {fileID: 100100000} 595 | m_GameObject: {fileID: 1039381711824346} 596 | m_Enabled: 1 597 | m_EditorHideFlags: 0 598 | m_Script: {fileID: 1679637790, guid: f70555f144d8491a825f0804e09c671c, type: 3} 599 | m_Name: 600 | m_EditorClassIdentifier: 601 | m_IgnoreLayout: 0 602 | m_MinWidth: -1 603 | m_MinHeight: -1 604 | m_PreferredWidth: -1 605 | m_PreferredHeight: 50 606 | m_FlexibleWidth: -1 607 | m_FlexibleHeight: -1 608 | m_LayoutPriority: 1 609 | --- !u!114 &114650198518640616 610 | MonoBehaviour: 611 | m_ObjectHideFlags: 1 612 | m_PrefabParentObject: {fileID: 0} 613 | m_PrefabInternal: {fileID: 100100000} 614 | m_GameObject: {fileID: 1144066272502726} 615 | m_Enabled: 1 616 | m_EditorHideFlags: 0 617 | m_Script: {fileID: -146154839, guid: f70555f144d8491a825f0804e09c671c, type: 3} 618 | m_Name: 619 | m_EditorClassIdentifier: 620 | --- !u!114 &114673989187842768 621 | MonoBehaviour: 622 | m_ObjectHideFlags: 1 623 | m_PrefabParentObject: {fileID: 0} 624 | m_PrefabInternal: {fileID: 100100000} 625 | m_GameObject: {fileID: 1039381711824346} 626 | m_Enabled: 1 627 | m_EditorHideFlags: 0 628 | m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3} 629 | m_Name: 630 | m_EditorClassIdentifier: 631 | m_Navigation: 632 | m_Mode: 3 633 | m_SelectOnUp: {fileID: 0} 634 | m_SelectOnDown: {fileID: 0} 635 | m_SelectOnLeft: {fileID: 0} 636 | m_SelectOnRight: {fileID: 0} 637 | m_Transition: 1 638 | m_Colors: 639 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 640 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 641 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 642 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 643 | m_ColorMultiplier: 1 644 | m_FadeDuration: 0.1 645 | m_SpriteState: 646 | m_HighlightedSprite: {fileID: 0} 647 | m_PressedSprite: {fileID: 0} 648 | m_DisabledSprite: {fileID: 0} 649 | m_AnimationTriggers: 650 | m_NormalTrigger: Normal 651 | m_HighlightedTrigger: Highlighted 652 | m_PressedTrigger: Pressed 653 | m_DisabledTrigger: Disabled 654 | m_Interactable: 1 655 | m_TargetGraphic: {fileID: 114128097878744328} 656 | m_TextComponent: {fileID: 114885290307651388} 657 | m_Placeholder: {fileID: 114022473735688804} 658 | m_ContentType: 0 659 | m_InputType: 0 660 | m_AsteriskChar: 42 661 | m_KeyboardType: 0 662 | m_LineType: 0 663 | m_HideMobileInput: 0 664 | m_CharacterValidation: 0 665 | m_CharacterLimit: 0 666 | m_OnEndEdit: 667 | m_PersistentCalls: 668 | m_Calls: [] 669 | m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0, 670 | Culture=neutral, PublicKeyToken=null 671 | m_OnValueChanged: 672 | m_PersistentCalls: 673 | m_Calls: [] 674 | m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0, 675 | Culture=neutral, PublicKeyToken=null 676 | m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 677 | m_CustomCaretColor: 0 678 | m_SelectionColor: {r: 0, g: 0.78676474, b: 0.13564911, a: 0.597} 679 | m_Text: 680 | m_CaretBlinkRate: 0.85 681 | m_CaretWidth: 1 682 | m_ReadOnly: 0 683 | --- !u!114 &114749364560048702 684 | MonoBehaviour: 685 | m_ObjectHideFlags: 1 686 | m_PrefabParentObject: {fileID: 0} 687 | m_PrefabInternal: {fileID: 100100000} 688 | m_GameObject: {fileID: 1306600296809728} 689 | m_Enabled: 1 690 | m_EditorHideFlags: 0 691 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 692 | m_Name: 693 | m_EditorClassIdentifier: 694 | m_Material: {fileID: 0} 695 | m_Color: {r: 0, g: 0, b: 0, a: 1} 696 | m_RaycastTarget: 1 697 | m_OnCullStateChanged: 698 | m_PersistentCalls: 699 | m_Calls: [] 700 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 701 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 702 | m_FontData: 703 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 704 | m_FontSize: 40 705 | m_FontStyle: 0 706 | m_BestFit: 0 707 | m_MinSize: 4 708 | m_MaxSize: 40 709 | m_Alignment: 4 710 | m_AlignByGeometry: 0 711 | m_RichText: 1 712 | m_HorizontalOverflow: 0 713 | m_VerticalOverflow: 0 714 | m_LineSpacing: 1 715 | m_Text: '>' 716 | --- !u!114 &114777148721092576 717 | MonoBehaviour: 718 | m_ObjectHideFlags: 1 719 | m_PrefabParentObject: {fileID: 0} 720 | m_PrefabInternal: {fileID: 100100000} 721 | m_GameObject: {fileID: 1189937722084398} 722 | m_Enabled: 1 723 | m_EditorHideFlags: 0 724 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 725 | m_Name: 726 | m_EditorClassIdentifier: 727 | m_Material: {fileID: 0} 728 | m_Color: {r: 0.011758606, g: 0.341, b: 0, a: 0.5019608} 729 | m_RaycastTarget: 1 730 | m_OnCullStateChanged: 731 | m_PersistentCalls: 732 | m_Calls: [] 733 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 734 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 735 | m_Sprite: {fileID: 0} 736 | m_Type: 0 737 | m_PreserveAspect: 0 738 | m_FillCenter: 1 739 | m_FillMethod: 4 740 | m_FillAmount: 1 741 | m_FillClockwise: 1 742 | m_FillOrigin: 0 743 | --- !u!114 &114831913987979466 744 | MonoBehaviour: 745 | m_ObjectHideFlags: 1 746 | m_PrefabParentObject: {fileID: 0} 747 | m_PrefabInternal: {fileID: 100100000} 748 | m_GameObject: {fileID: 1214164961261658} 749 | m_Enabled: 1 750 | m_EditorHideFlags: 0 751 | m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 752 | m_Name: 753 | m_EditorClassIdentifier: 754 | m_UiScaleMode: 1 755 | m_ReferencePixelsPerUnit: 100 756 | m_ScaleFactor: 1 757 | m_ReferenceResolution: {x: 800, y: 600} 758 | m_ScreenMatchMode: 0 759 | m_MatchWidthOrHeight: 0.7 760 | m_PhysicalUnit: 3 761 | m_FallbackScreenDPI: 96 762 | m_DefaultSpriteDPI: 96 763 | m_DynamicPixelsPerUnit: 1 764 | --- !u!114 &114876528512499110 765 | MonoBehaviour: 766 | m_ObjectHideFlags: 1 767 | m_PrefabParentObject: {fileID: 0} 768 | m_PrefabInternal: {fileID: 100100000} 769 | m_GameObject: {fileID: 1390798660830614} 770 | m_Enabled: 1 771 | m_EditorHideFlags: 0 772 | m_Script: {fileID: 11500000, guid: e1f3e1f04693ed04986a3a3f8f00fc9b, type: 3} 773 | m_Name: 774 | m_EditorClassIdentifier: 775 | output: {fileID: 114543574800599530} 776 | input: {fileID: 114673989187842768} 777 | enter: {fileID: 114250581840642414} 778 | cancel: {fileID: 114363751505445506} 779 | --- !u!114 &114885290307651388 780 | MonoBehaviour: 781 | m_ObjectHideFlags: 1 782 | m_PrefabParentObject: {fileID: 0} 783 | m_PrefabInternal: {fileID: 100100000} 784 | m_GameObject: {fileID: 1034669198820538} 785 | m_Enabled: 1 786 | m_EditorHideFlags: 0 787 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 788 | m_Name: 789 | m_EditorClassIdentifier: 790 | m_Material: {fileID: 0} 791 | m_Color: {r: 1, g: 1, b: 1, a: 1} 792 | m_RaycastTarget: 1 793 | m_OnCullStateChanged: 794 | m_PersistentCalls: 795 | m_Calls: [] 796 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 797 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 798 | m_FontData: 799 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 800 | m_FontSize: 14 801 | m_FontStyle: 0 802 | m_BestFit: 0 803 | m_MinSize: 10 804 | m_MaxSize: 40 805 | m_Alignment: 0 806 | m_AlignByGeometry: 0 807 | m_RichText: 0 808 | m_HorizontalOverflow: 1 809 | m_VerticalOverflow: 0 810 | m_LineSpacing: 1 811 | m_Text: 812 | --- !u!114 &114917037866404870 813 | MonoBehaviour: 814 | m_ObjectHideFlags: 1 815 | m_PrefabParentObject: {fileID: 0} 816 | m_PrefabInternal: {fileID: 100100000} 817 | m_GameObject: {fileID: 1214164961261658} 818 | m_Enabled: 1 819 | m_EditorHideFlags: 0 820 | m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 821 | m_Name: 822 | m_EditorClassIdentifier: 823 | m_IgnoreReversedGraphics: 1 824 | m_BlockingObjects: 0 825 | m_BlockingMask: 826 | serializedVersion: 2 827 | m_Bits: 4294967295 828 | --- !u!114 &114959810981306300 829 | MonoBehaviour: 830 | m_ObjectHideFlags: 1 831 | m_PrefabParentObject: {fileID: 0} 832 | m_PrefabInternal: {fileID: 100100000} 833 | m_GameObject: {fileID: 1144066272502726} 834 | m_Enabled: 1 835 | m_EditorHideFlags: 0 836 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 837 | m_Name: 838 | m_EditorClassIdentifier: 839 | m_Material: {fileID: 0} 840 | m_Color: {r: 0, g: 0, b: 0, a: 0.5019608} 841 | m_RaycastTarget: 1 842 | m_OnCullStateChanged: 843 | m_PersistentCalls: 844 | m_Calls: [] 845 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 846 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 847 | m_Sprite: {fileID: 0} 848 | m_Type: 0 849 | m_PreserveAspect: 0 850 | m_FillCenter: 1 851 | m_FillMethod: 4 852 | m_FillAmount: 1 853 | m_FillClockwise: 1 854 | m_FillOrigin: 0 855 | --- !u!222 &222067853971939906 856 | CanvasRenderer: 857 | m_ObjectHideFlags: 1 858 | m_PrefabParentObject: {fileID: 0} 859 | m_PrefabInternal: {fileID: 100100000} 860 | m_GameObject: {fileID: 1306600296809728} 861 | --- !u!222 &222103559350871666 862 | CanvasRenderer: 863 | m_ObjectHideFlags: 1 864 | m_PrefabParentObject: {fileID: 0} 865 | m_PrefabInternal: {fileID: 100100000} 866 | m_GameObject: {fileID: 1228869779680382} 867 | --- !u!222 &222115443006781528 868 | CanvasRenderer: 869 | m_ObjectHideFlags: 1 870 | m_PrefabParentObject: {fileID: 0} 871 | m_PrefabInternal: {fileID: 100100000} 872 | m_GameObject: {fileID: 1687759447770254} 873 | --- !u!222 &222294455750674388 874 | CanvasRenderer: 875 | m_ObjectHideFlags: 1 876 | m_PrefabParentObject: {fileID: 0} 877 | m_PrefabInternal: {fileID: 100100000} 878 | m_GameObject: {fileID: 1144066272502726} 879 | --- !u!222 &222328545949047970 880 | CanvasRenderer: 881 | m_ObjectHideFlags: 1 882 | m_PrefabParentObject: {fileID: 0} 883 | m_PrefabInternal: {fileID: 100100000} 884 | m_GameObject: {fileID: 1039381711824346} 885 | --- !u!222 &222409435024748324 886 | CanvasRenderer: 887 | m_ObjectHideFlags: 1 888 | m_PrefabParentObject: {fileID: 0} 889 | m_PrefabInternal: {fileID: 100100000} 890 | m_GameObject: {fileID: 1521756874805372} 891 | --- !u!222 &222551766854666022 892 | CanvasRenderer: 893 | m_ObjectHideFlags: 1 894 | m_PrefabParentObject: {fileID: 0} 895 | m_PrefabInternal: {fileID: 100100000} 896 | m_GameObject: {fileID: 1034669198820538} 897 | --- !u!222 &222566617607703184 898 | CanvasRenderer: 899 | m_ObjectHideFlags: 1 900 | m_PrefabParentObject: {fileID: 0} 901 | m_PrefabInternal: {fileID: 100100000} 902 | m_GameObject: {fileID: 1478958097393808} 903 | --- !u!222 &222648513230845526 904 | CanvasRenderer: 905 | m_ObjectHideFlags: 1 906 | m_PrefabParentObject: {fileID: 0} 907 | m_PrefabInternal: {fileID: 100100000} 908 | m_GameObject: {fileID: 1142309470677772} 909 | --- !u!222 &222829222803743182 910 | CanvasRenderer: 911 | m_ObjectHideFlags: 1 912 | m_PrefabParentObject: {fileID: 0} 913 | m_PrefabInternal: {fileID: 100100000} 914 | m_GameObject: {fileID: 1833153178863488} 915 | --- !u!222 &222845575662104756 916 | CanvasRenderer: 917 | m_ObjectHideFlags: 1 918 | m_PrefabParentObject: {fileID: 0} 919 | m_PrefabInternal: {fileID: 100100000} 920 | m_GameObject: {fileID: 1189937722084398} 921 | --- !u!223 &223144819959694060 922 | Canvas: 923 | m_ObjectHideFlags: 1 924 | m_PrefabParentObject: {fileID: 0} 925 | m_PrefabInternal: {fileID: 100100000} 926 | m_GameObject: {fileID: 1214164961261658} 927 | m_Enabled: 1 928 | serializedVersion: 3 929 | m_RenderMode: 0 930 | m_Camera: {fileID: 0} 931 | m_PlaneDistance: 100 932 | m_PixelPerfect: 1 933 | m_ReceivesEvents: 1 934 | m_OverrideSorting: 0 935 | m_OverridePixelPerfect: 0 936 | m_SortingBucketNormalizedSize: 0 937 | m_AdditionalShaderChannelsFlag: 0 938 | m_SortingLayerID: 0 939 | m_SortingOrder: 32767 940 | m_TargetDisplay: 0 941 | --- !u!224 &224015628564908606 942 | RectTransform: 943 | m_ObjectHideFlags: 1 944 | m_PrefabParentObject: {fileID: 0} 945 | m_PrefabInternal: {fileID: 100100000} 946 | m_GameObject: {fileID: 1687759447770254} 947 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 948 | m_LocalPosition: {x: 0, y: 0, z: 0} 949 | m_LocalScale: {x: 1.0000042, y: 1.0000042, z: 1.0000042} 950 | m_Children: 951 | - {fileID: 224815689957065318} 952 | m_Father: {fileID: 224626620451390332} 953 | m_RootOrder: 3 954 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 955 | m_AnchorMin: {x: 1, y: 0} 956 | m_AnchorMax: {x: 1, y: 1} 957 | m_AnchoredPosition: {x: -0.00012207031, y: 0} 958 | m_SizeDelta: {x: 80, y: 0} 959 | m_Pivot: {x: 1, y: 0.5} 960 | --- !u!224 &224061364481137378 961 | RectTransform: 962 | m_ObjectHideFlags: 1 963 | m_PrefabParentObject: {fileID: 0} 964 | m_PrefabInternal: {fileID: 100100000} 965 | m_GameObject: {fileID: 1478958097393808} 966 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 967 | m_LocalPosition: {x: 0, y: 0, z: 0} 968 | m_LocalScale: {x: 1, y: 1, z: 1} 969 | m_Children: 970 | - {fileID: 224288975493165162} 971 | m_Father: {fileID: 224626620451390332} 972 | m_RootOrder: 2 973 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 974 | m_AnchorMin: {x: 1, y: 0} 975 | m_AnchorMax: {x: 1, y: 1} 976 | m_AnchoredPosition: {x: 0, y: 0} 977 | m_SizeDelta: {x: 80, y: 0} 978 | m_Pivot: {x: 1, y: 0.5} 979 | --- !u!224 &224205846502228218 980 | RectTransform: 981 | m_ObjectHideFlags: 1 982 | m_PrefabParentObject: {fileID: 0} 983 | m_PrefabInternal: {fileID: 100100000} 984 | m_GameObject: {fileID: 1521756874805372} 985 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 986 | m_LocalPosition: {x: 0, y: 0, z: 0} 987 | m_LocalScale: {x: 0.999996, y: 0.999996, z: 0.999996} 988 | m_Children: [] 989 | m_Father: {fileID: 224626620451390332} 990 | m_RootOrder: 1 991 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 992 | m_AnchorMin: {x: 0, y: 0} 993 | m_AnchorMax: {x: 1, y: 1} 994 | m_AnchoredPosition: {x: -40, y: 0} 995 | m_SizeDelta: {x: -80, y: 0} 996 | m_Pivot: {x: 0.5, y: 0.5} 997 | --- !u!224 &224267762115843528 998 | RectTransform: 999 | m_ObjectHideFlags: 1 1000 | m_PrefabParentObject: {fileID: 0} 1001 | m_PrefabInternal: {fileID: 100100000} 1002 | m_GameObject: {fileID: 1228869779680382} 1003 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1004 | m_LocalPosition: {x: 0, y: 0, z: 0} 1005 | m_LocalScale: {x: 1, y: 1, z: 1} 1006 | m_Children: 1007 | - {fileID: 224856670432556356} 1008 | - {fileID: 224626620451390332} 1009 | m_Father: {fileID: 224594898992846504} 1010 | m_RootOrder: 0 1011 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1012 | m_AnchorMin: {x: 0, y: 0.5} 1013 | m_AnchorMax: {x: 1, y: 1} 1014 | m_AnchoredPosition: {x: 0, y: 0} 1015 | m_SizeDelta: {x: 0, y: 0} 1016 | m_Pivot: {x: 0, y: 1} 1017 | --- !u!224 &224288975493165162 1018 | RectTransform: 1019 | m_ObjectHideFlags: 1 1020 | m_PrefabParentObject: {fileID: 0} 1021 | m_PrefabInternal: {fileID: 100100000} 1022 | m_GameObject: {fileID: 1306600296809728} 1023 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1024 | m_LocalPosition: {x: 0, y: 0, z: 0} 1025 | m_LocalScale: {x: 1, y: 1, z: 1} 1026 | m_Children: [] 1027 | m_Father: {fileID: 224061364481137378} 1028 | m_RootOrder: 0 1029 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1030 | m_AnchorMin: {x: 0, y: 0} 1031 | m_AnchorMax: {x: 1, y: 1} 1032 | m_AnchoredPosition: {x: 0, y: 0} 1033 | m_SizeDelta: {x: 0, y: 0} 1034 | m_Pivot: {x: 0.5, y: 0.5} 1035 | --- !u!224 &224499242075774682 1036 | RectTransform: 1037 | m_ObjectHideFlags: 1 1038 | m_PrefabParentObject: {fileID: 0} 1039 | m_PrefabInternal: {fileID: 100100000} 1040 | m_GameObject: {fileID: 1034669198820538} 1041 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1042 | m_LocalPosition: {x: 0, y: 0, z: 0} 1043 | m_LocalScale: {x: 1, y: 1, z: 1} 1044 | m_Children: [] 1045 | m_Father: {fileID: 224626620451390332} 1046 | m_RootOrder: 0 1047 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1048 | m_AnchorMin: {x: 0, y: 0} 1049 | m_AnchorMax: {x: 1, y: 1} 1050 | m_AnchoredPosition: {x: -37.5, y: 0} 1051 | m_SizeDelta: {x: -85, y: -10} 1052 | m_Pivot: {x: 0.5, y: 0.5} 1053 | --- !u!224 &224594898992846504 1054 | RectTransform: 1055 | m_ObjectHideFlags: 1 1056 | m_PrefabParentObject: {fileID: 0} 1057 | m_PrefabInternal: {fileID: 100100000} 1058 | m_GameObject: {fileID: 1189937722084398} 1059 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1060 | m_LocalPosition: {x: 0, y: 0, z: 0} 1061 | m_LocalScale: {x: 1, y: 1, z: 1} 1062 | m_Children: 1063 | - {fileID: 224267762115843528} 1064 | m_Father: {fileID: 224752089099485032} 1065 | m_RootOrder: 0 1066 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1067 | m_AnchorMin: {x: 0, y: 0} 1068 | m_AnchorMax: {x: 1, y: 1} 1069 | m_AnchoredPosition: {x: 0, y: 0.064941406} 1070 | m_SizeDelta: {x: 0, y: 0} 1071 | m_Pivot: {x: 1, y: 1} 1072 | --- !u!224 &224615508052113150 1073 | RectTransform: 1074 | m_ObjectHideFlags: 1 1075 | m_PrefabParentObject: {fileID: 0} 1076 | m_PrefabInternal: {fileID: 100100000} 1077 | m_GameObject: {fileID: 1833153178863488} 1078 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1079 | m_LocalPosition: {x: 0, y: 0, z: 0} 1080 | m_LocalScale: {x: 1, y: 1, z: 1} 1081 | m_Children: [] 1082 | m_Father: {fileID: 224856670432556356} 1083 | m_RootOrder: 0 1084 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1085 | m_AnchorMin: {x: 0, y: 0} 1086 | m_AnchorMax: {x: 1, y: 0} 1087 | m_AnchoredPosition: {x: 0, y: 0.085739136} 1088 | m_SizeDelta: {x: 0, y: 0} 1089 | m_Pivot: {x: 0, y: 0} 1090 | --- !u!224 &224626620451390332 1091 | RectTransform: 1092 | m_ObjectHideFlags: 1 1093 | m_PrefabParentObject: {fileID: 0} 1094 | m_PrefabInternal: {fileID: 100100000} 1095 | m_GameObject: {fileID: 1039381711824346} 1096 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1097 | m_LocalPosition: {x: 0, y: 0, z: 0} 1098 | m_LocalScale: {x: 1, y: 1, z: 1} 1099 | m_Children: 1100 | - {fileID: 224499242075774682} 1101 | - {fileID: 224205846502228218} 1102 | - {fileID: 224061364481137378} 1103 | - {fileID: 224015628564908606} 1104 | m_Father: {fileID: 224267762115843528} 1105 | m_RootOrder: 1 1106 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1107 | m_AnchorMin: {x: 0, y: 0} 1108 | m_AnchorMax: {x: 1, y: 0} 1109 | m_AnchoredPosition: {x: 0, y: 0} 1110 | m_SizeDelta: {x: 0, y: 50} 1111 | m_Pivot: {x: 0.5, y: 0} 1112 | --- !u!224 &224752089099485032 1113 | RectTransform: 1114 | m_ObjectHideFlags: 1 1115 | m_PrefabParentObject: {fileID: 0} 1116 | m_PrefabInternal: {fileID: 100100000} 1117 | m_GameObject: {fileID: 1214164961261658} 1118 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1119 | m_LocalPosition: {x: 0, y: 0, z: 0} 1120 | m_LocalScale: {x: 0, y: 0, z: 0} 1121 | m_Children: 1122 | - {fileID: 224594898992846504} 1123 | m_Father: {fileID: 4426163278932142} 1124 | m_RootOrder: 0 1125 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1126 | m_AnchorMin: {x: 0, y: 0} 1127 | m_AnchorMax: {x: 0, y: 0} 1128 | m_AnchoredPosition: {x: 0, y: 0} 1129 | m_SizeDelta: {x: 0, y: 0} 1130 | m_Pivot: {x: 0, y: 0} 1131 | --- !u!224 &224815689957065318 1132 | RectTransform: 1133 | m_ObjectHideFlags: 1 1134 | m_PrefabParentObject: {fileID: 0} 1135 | m_PrefabInternal: {fileID: 100100000} 1136 | m_GameObject: {fileID: 1142309470677772} 1137 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1138 | m_LocalPosition: {x: 0, y: 0, z: 0} 1139 | m_LocalScale: {x: 1, y: 1, z: 1} 1140 | m_Children: [] 1141 | m_Father: {fileID: 224015628564908606} 1142 | m_RootOrder: 0 1143 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1144 | m_AnchorMin: {x: 0, y: 0} 1145 | m_AnchorMax: {x: 1, y: 1} 1146 | m_AnchoredPosition: {x: 0, y: 0} 1147 | m_SizeDelta: {x: 0, y: 0} 1148 | m_Pivot: {x: 0.5, y: 0.5} 1149 | --- !u!224 &224856670432556356 1150 | RectTransform: 1151 | m_ObjectHideFlags: 1 1152 | m_PrefabParentObject: {fileID: 0} 1153 | m_PrefabInternal: {fileID: 100100000} 1154 | m_GameObject: {fileID: 1144066272502726} 1155 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 1156 | m_LocalPosition: {x: 0, y: 0, z: 0} 1157 | m_LocalScale: {x: 1, y: 1, z: 1} 1158 | m_Children: 1159 | - {fileID: 224615508052113150} 1160 | m_Father: {fileID: 224267762115843528} 1161 | m_RootOrder: 0 1162 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1163 | m_AnchorMin: {x: 0, y: 0} 1164 | m_AnchorMax: {x: 1, y: 1} 1165 | m_AnchoredPosition: {x: 0, y: 25} 1166 | m_SizeDelta: {x: -10, y: -60} 1167 | m_Pivot: {x: 0.5, y: 0.5} 1168 | --- !u!225 &225342966786627282 1169 | CanvasGroup: 1170 | m_ObjectHideFlags: 1 1171 | m_PrefabParentObject: {fileID: 0} 1172 | m_PrefabInternal: {fileID: 100100000} 1173 | m_GameObject: {fileID: 1189937722084398} 1174 | m_Enabled: 0 1175 | m_Alpha: 0.5 1176 | m_Interactable: 1 1177 | m_BlocksRaycasts: 1 1178 | m_IgnoreParentGroups: 0 1179 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugConsole/Resources/DebugConsole.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e50b3ded1c25db947b52c90b2bd685da 3 | timeCreated: 1522989747 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bd435dd627917846938b55959dd3611 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/DebugPanel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace Yurowm.DebugTools { 7 | public class DebugPanel : MonoBehaviour { 8 | 9 | static DebugPanel _Instance = null; 10 | public static DebugPanel Instance { 11 | get { 12 | if (!_Instance && Application.isPlaying) { 13 | _Instance = FindObjectOfType(); 14 | if (!_Instance) { 15 | _Instance = Resources.Load("DebugPanel"); 16 | if (_Instance) { 17 | _Instance = Instantiate(_Instance.gameObject).GetComponent(); 18 | _Instance.transform.localPosition = Vector3.zero; 19 | _Instance.transform.localRotation = Quaternion.identity; 20 | _Instance.transform.localScale = Vector3.one; 21 | _Instance.name = "DebugPanel"; 22 | _Instance.gameObject.SetActive(false); 23 | _Instance.gameObject.hideFlags = HideFlags.HideInHierarchy | HideFlags.DontSave; 24 | if (Application.isEditor) 25 | _Instance.gameObject.SetActive(false); 26 | } 27 | } 28 | } 29 | return _Instance; 30 | } 31 | } 32 | 33 | public bool lockOnStart = true; 34 | public bool ignoreDefLogOnStart = true; 35 | public bool hideNewCategories = true; 36 | public bool onlyInDebugMode = true; 37 | 38 | bool ignoreDefLog = false; 39 | bool locked = false; 40 | 41 | const string delegatesCategory = "Delegates"; 42 | 43 | public GameObject textItemPrefab; 44 | public GameObject buttonItemPrefab; 45 | public GameObject categoryItemPrefab; 46 | 47 | public Transform logContent; 48 | public Transform categoryContent; 49 | public Transform controlPanel; 50 | 51 | public Button lockButton; 52 | public Button unlockButton; 53 | public Button clearButton; 54 | public Button deflogButton; 55 | public Button showAllButton; 56 | public Button hideAllButton; 57 | public Button closeButton; 58 | 59 | public CanvasGroup group; 60 | public Transform unlockPanel; 61 | 62 | 63 | public static Dictionary categories = new Dictionary(); 64 | 65 | public static Dictionary messages = new Dictionary(); 66 | public static Dictionary buttons = new Dictionary(); 67 | 68 | // Colors 69 | static Color systemColor = new Color(0.4f, 1f, 0.6f, 1); 70 | static Color warningColor = new Color(0.9f, 0.9f, 0.4f, 1); 71 | static Color errorColor = new Color(1f, 0.4f, 0.4f, 1); 72 | 73 | // FPS 74 | float fpsUpdateDelay = 0.5f; 75 | float fpsTime = 0f; 76 | int FPSCounter = 0; 77 | public static bool isActive { 78 | get { 79 | return Instance && Instance.gameObject.activeSelf; 80 | } 81 | } 82 | 83 | // Use this for initialization 84 | void Awake () { 85 | if (onlyInDebugMode && !Debug.isDebugBuild) { 86 | Destroy(gameObject); 87 | return; 88 | } 89 | 90 | group.gameObject.SetActive(true); 91 | unlockPanel.gameObject.SetActive(true); 92 | 93 | lockButton.onClick.AddListener(() => { 94 | locked = true; 95 | controlPanel.gameObject.SetActive(false); 96 | categoryContent.gameObject.SetActive(false); 97 | unlockPanel.gameObject.SetActive(true); 98 | group.alpha = 0.5f; 99 | group.blocksRaycasts = false; 100 | foreach (Button button in buttons.Values.ToArray()) 101 | button.gameObject.SetActive(false); 102 | }); 103 | 104 | unlockButton.onClick.AddListener(() => { 105 | locked = false; 106 | controlPanel.gameObject.SetActive(true); 107 | categoryContent.gameObject.SetActive(true); 108 | unlockPanel.gameObject.SetActive(false); 109 | group.alpha = 1f; 110 | group.blocksRaycasts = true; 111 | if (categories.ContainsKey(delegatesCategory)) 112 | foreach (Button button in buttons.Values.ToArray()) 113 | button.gameObject.SetActive(categories[delegatesCategory].state); 114 | }); 115 | 116 | clearButton.onClick.AddListener(Clear); 117 | 118 | deflogButton.GetComponent().color = ignoreDefLog ? Color.green : Color.white; 119 | deflogButton.onClick.AddListener(() => { 120 | ignoreDefLog = !ignoreDefLog; 121 | deflogButton.GetComponent().color = ignoreDefLog ? Color.green : Color.white; 122 | }); 123 | 124 | showAllButton.onClick.AddListener(() => { 125 | Image image; 126 | Color c; 127 | foreach (Category category in categories.Values.ToArray()) { 128 | category.state = true; 129 | image = category.button.GetComponent(); 130 | c = image.color; 131 | c.a = category.state ? 1f : 0.5f; 132 | } 133 | }); 134 | 135 | hideAllButton.onClick.AddListener(() => { 136 | Image image; 137 | Color c; 138 | foreach (Category category in categories.Values.ToArray()) { 139 | category.state = false; 140 | image = category.button.GetComponent(); 141 | c = image.color; 142 | c.a = category.state ? 1f : 0.5f; 143 | } 144 | }); 145 | 146 | closeButton.onClick.AddListener(() => { 147 | Instance.gameObject.SetActive(false); 148 | }); 149 | 150 | if (lockOnStart) 151 | lockButton.onClick.Invoke(); 152 | 153 | if (ignoreDefLogOnStart && Application.isEditor) 154 | deflogButton.onClick.Invoke(); 155 | 156 | Application.logMessageReceived += HandleLog; 157 | } 158 | 159 | void Update() { 160 | if (!isActive) 161 | return; 162 | FPSCounter++; 163 | if (fpsTime + fpsUpdateDelay < Time.unscaledTime) { 164 | FPSCounter = Mathf.RoundToInt(1f * FPSCounter / (Time.unscaledTime - fpsTime)); 165 | 166 | Log("FPS", "System", FPSCounter); 167 | fpsTime = Time.unscaledTime; 168 | FPSCounter = 0; 169 | 170 | Log("DeviceID", "System", SystemInfo.deviceUniqueIdentifier); 171 | } 172 | } 173 | 174 | void OnDestroy() { 175 | Application.logMessageReceived -= HandleLog; 176 | buttons.Clear(); 177 | messages.Clear(); 178 | categories.Clear(); 179 | } 180 | 181 | void HandleLog(string logString, string stackTrace, LogType type) { 182 | if (ignoreDefLog) 183 | return; 184 | 185 | 186 | switch (type) { 187 | case LogType.Exception: 188 | case LogType.Error: 189 | Log((stackTrace + logString).GetHashCode().ToString(), "Error", stackTrace, logString); 190 | break; 191 | case LogType.Warning: 192 | Log((stackTrace + logString).GetHashCode().ToString(), "Warning", stackTrace, logString); 193 | break; 194 | default: 195 | Log((stackTrace + logString).GetHashCode().ToString(), "Log", logString); 196 | break; 197 | } 198 | } 199 | 200 | public static void Clear() { 201 | foreach (Message message in messages.Values.ToArray()) 202 | Destroy(message.display.gameObject); 203 | messages.Clear(); 204 | } 205 | 206 | public static void Log(string _name, object _message) { 207 | Log(_name, "N/A", _message); 208 | } 209 | 210 | public static void Log(string _name, string _category, string _stacktrace, object _message) { 211 | Log(_name, _category, _message.ToString() + "\n" + _stacktrace); 212 | } 213 | 214 | public static void Log(string _name, string _category, object _message) { 215 | if (Instance == null) 216 | return; 217 | 218 | Message message; 219 | string key = _name + "_" + _category; 220 | 221 | if (!messages.ContainsKey(key)) { 222 | message = new Message(); 223 | message.name = _name; 224 | message.category = _category; 225 | RegisterNewMessage(ref message); 226 | } else 227 | message = messages[key]; 228 | 229 | message.text = _message.ToString(); 230 | 231 | message.Update(); 232 | } 233 | 234 | public static void AddDelegate(string _name, UnityEngine.Events.UnityAction action) { 235 | if (Instance == null) 236 | return; 237 | 238 | Button button; 239 | if (!buttons.ContainsKey(_name)) { 240 | button = RegisterNewDelegate(_name); 241 | } else 242 | button = buttons[_name]; 243 | 244 | button.onClick.AddListener(action); 245 | } 246 | 247 | static Button RegisterNewDelegate(string _name) { 248 | GameObject buttonItem = Instantiate(Instance.buttonItemPrefab); 249 | buttonItem.transform.SetParent(Instance.logContent); 250 | buttonItem.transform.localScale = Vector3.one; 251 | 252 | buttonItem.GetComponentInChildren().text = _name; 253 | 254 | if (!categories.ContainsKey(delegatesCategory)) 255 | RegisterNewCategory(delegatesCategory); 256 | 257 | Button button = buttonItem.GetComponent