├── README.md ├── Packages └── manifest.json ├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── NetworkManager.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── AudioManager.asset ├── TagManager.asset ├── EditorSettings.asset ├── PresetManager.asset ├── UnityConnectSettings.asset ├── DynamicsManager.asset ├── Physics2DSettings.asset ├── NavMeshAreas.asset ├── GraphicsSettings.asset ├── QualitySettings.asset ├── InputManager.asset └── ProjectSettings.asset ├── Release └── DebugPanel.unitypackage ├── Assets ├── Yurowm.meta └── Yurowm │ ├── Test │ ├── Test.unity.meta │ ├── Test.cs.meta │ └── Test.cs │ ├── DebugPanel.meta │ ├── DebugConsole.meta │ ├── Test.meta │ ├── DebugConsole │ ├── Editor.meta │ ├── Resources.meta │ ├── Resources │ │ ├── DebugConsole.prefab.meta │ │ └── DebugConsole.prefab │ ├── Editor │ │ ├── DebugConsoleView.cs.meta │ │ └── DebugConsoleView.cs │ ├── ICommand.cs.meta │ ├── DebugConsole.cs.meta │ ├── ExampleCommands.cs.meta │ ├── DebugConsole.cs │ ├── ICommand.cs │ └── ExampleCommands.cs │ └── DebugPanel │ ├── Editor.meta │ ├── Resources.meta │ ├── Resources │ ├── TextItem.prefab.meta │ ├── ButtonItem.prefab.meta │ ├── CategoryItem.prefab.meta │ ├── DebugPanel.prefab.meta │ ├── TextItem.prefab │ ├── CategoryItem.prefab │ └── ButtonItem.prefab │ ├── Editor │ ├── DebugPanelView.cs.meta │ └── DebugPanelView.cs │ ├── DebugPanel.cs.meta │ └── DebugPanel.cs └── .gitignore /README.md: -------------------------------------------------------------------------------- 1 | DebugPanel 2 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.1.1f1 2 | -------------------------------------------------------------------------------- /Release/DebugPanel.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yurowm/UnityDebugTools/HEAD/Release/DebugPanel.unitypackage -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /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/Test/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /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/DebugConsole.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1414583fe2ef8534db2c258347e4934e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f704ae4b4f98ae41a0bce26658850c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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/DebugPanel/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b7c3720ef413314a9dff77f99d6b68a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c35ee58305eca1545a81e55412a39e11 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.0167 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources/TextItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82c2a34de24fc8a43a2f797098edc821 3 | timeCreated: 1453957798 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: debugpanel 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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/Resources/ButtonItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37caa2fc11e1bec4cb2d102b65f7d91f 3 | timeCreated: 1453957800 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: debugpanel 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources/CategoryItem.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a0bb6afc58644646895ca395094d956 3 | timeCreated: 1453957811 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: debugpanel 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources/DebugPanel.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1840ee7b5445994cbb7bb281433d730 3 | timeCreated: 1453964495 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: -1 7 | userData: 8 | assetBundleName: debugpanel 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Yurowm/Test/Test.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 822b1b422016864429fd22d15eb03078 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/DebugPanel/Editor/DebugPanelView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c5afff222341d946a35f0fed4f5e83b 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/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/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 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /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/DebugPanel/DebugPanel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd74e487afb3ec1479bd08957cfe50dd 3 | timeCreated: 1459243951 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: -100 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - PostProcessing 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /Assets/Yurowm/Test/Test.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Yurowm.DebugTools; 5 | 6 | namespace Yurowm.DebugToolsTest { 7 | public class Test : MonoBehaviour { 8 | 9 | void Update () { 10 | DebugPanel.Log("Mouse Position", "Input", Input.mousePosition); 11 | } 12 | 13 | public void A() { 14 | DebugPanel.Log("Log name", "Some text"); 15 | } 16 | 17 | public void B() { 18 | DebugPanel.Log("Button", "Other", "Clicked"); 19 | } 20 | 21 | int counter = 0; 22 | public void C() { 23 | DebugPanel.Log("Counter", "Other", ++counter); 24 | } 25 | 26 | public void D() { 27 | DebugPanel.Log("Game Time", "Other", Time.time); 28 | } 29 | 30 | public void E() { 31 | DebugPanel.Log("Name", "Other", gameObject.name); 32 | } 33 | 34 | public void F() { 35 | DebugPanel.AddDelegate("Kill the enemy", () => Debug.Log("Enemy is killed!")); 36 | } 37 | 38 | [QuickCommand(@"test quick command", "SomeText 123", "just for testing! Check how it works")] 39 | public static void TestQuickCommand(string text, int number) { 40 | Debug.Log("Text: " + text + ", Number: " + number.ToString()); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources/TextItem.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &149012 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 5 9 | m_Component: 10 | - component: {fileID: 22451838} 11 | - component: {fileID: 22298084} 12 | - component: {fileID: 11447188} 13 | - component: {fileID: 11433592} 14 | m_Layer: 0 15 | m_Name: TextItem 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!114 &11433592 22 | MonoBehaviour: 23 | m_ObjectHideFlags: 1 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | m_GameObject: {fileID: 149012} 27 | m_Enabled: 1 28 | m_EditorHideFlags: 0 29 | m_Script: {fileID: 1741964061, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 30 | m_Name: 31 | m_EditorClassIdentifier: 32 | m_HorizontalFit: 0 33 | m_VerticalFit: 2 34 | --- !u!114 &11447188 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 1 37 | m_PrefabParentObject: {fileID: 0} 38 | m_PrefabInternal: {fileID: 100100000} 39 | m_GameObject: {fileID: 149012} 40 | m_Enabled: 1 41 | m_EditorHideFlags: 0 42 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 43 | m_Name: 44 | m_EditorClassIdentifier: 45 | m_Material: {fileID: 0} 46 | m_Color: {r: 1, g: 1, b: 1, a: 1} 47 | m_RaycastTarget: 1 48 | m_OnCullStateChanged: 49 | m_PersistentCalls: 50 | m_Calls: [] 51 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 52 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 53 | m_FontData: 54 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 55 | m_FontSize: 14 56 | m_FontStyle: 0 57 | m_BestFit: 0 58 | m_MinSize: 1 59 | m_MaxSize: 40 60 | m_Alignment: 0 61 | m_AlignByGeometry: 0 62 | m_RichText: 1 63 | m_HorizontalOverflow: 0 64 | m_VerticalOverflow: 0 65 | m_LineSpacing: 1 66 | m_Text: 'Name: Test message' 67 | --- !u!222 &22298084 68 | CanvasRenderer: 69 | m_ObjectHideFlags: 1 70 | m_PrefabParentObject: {fileID: 0} 71 | m_PrefabInternal: {fileID: 100100000} 72 | m_GameObject: {fileID: 149012} 73 | --- !u!224 &22451838 74 | RectTransform: 75 | m_ObjectHideFlags: 1 76 | m_PrefabParentObject: {fileID: 0} 77 | m_PrefabInternal: {fileID: 100100000} 78 | m_GameObject: {fileID: 149012} 79 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 80 | m_LocalPosition: {x: 0, y: 0, z: 0} 81 | m_LocalScale: {x: 1, y: 1, z: 1} 82 | m_Children: [] 83 | m_Father: {fileID: 0} 84 | m_RootOrder: 0 85 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 86 | m_AnchorMin: {x: 0, y: 0} 87 | m_AnchorMax: {x: 0, y: 0} 88 | m_AnchoredPosition: {x: 0, y: 0} 89 | m_SizeDelta: {x: 0, y: 0} 90 | m_Pivot: {x: 0.5, y: 0.5} 91 | --- !u!1001 &100100000 92 | Prefab: 93 | m_ObjectHideFlags: 1 94 | serializedVersion: 2 95 | m_Modification: 96 | m_TransformParent: {fileID: 0} 97 | m_Modifications: 98 | - target: {fileID: 0} 99 | propertyPath: m_FontData.m_FontSize 100 | value: 14 101 | objectReference: {fileID: 0} 102 | - target: {fileID: 0} 103 | propertyPath: m_FontData.m_MinSize 104 | value: 1 105 | objectReference: {fileID: 0} 106 | - target: {fileID: 0} 107 | propertyPath: m_EffectColor.a 108 | value: 1 109 | objectReference: {fileID: 0} 110 | - target: {fileID: 0} 111 | propertyPath: m_EffectDistance.y 112 | value: 1 113 | objectReference: {fileID: 0} 114 | m_RemovedComponents: [] 115 | m_ParentPrefab: {fileID: 0} 116 | m_RootGameObject: {fileID: 149012} 117 | m_IsPrefabParent: 1 118 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Resources/CategoryItem.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &120972 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 5 9 | m_Component: 10 | - component: {fileID: 22481696} 11 | - component: {fileID: 22212698} 12 | - component: {fileID: 11413600} 13 | - component: {fileID: 11413704} 14 | m_Layer: 0 15 | m_Name: CategoryItem 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!1 &158350 22 | GameObject: 23 | m_ObjectHideFlags: 0 24 | m_PrefabParentObject: {fileID: 0} 25 | m_PrefabInternal: {fileID: 100100000} 26 | serializedVersion: 5 27 | m_Component: 28 | - component: {fileID: 22405166} 29 | - component: {fileID: 22201782} 30 | - component: {fileID: 11415510} 31 | m_Layer: 0 32 | m_Name: Text 33 | m_TagString: Untagged 34 | m_Icon: {fileID: 0} 35 | m_NavMeshLayer: 0 36 | m_StaticEditorFlags: 0 37 | m_IsActive: 1 38 | --- !u!114 &11413600 39 | MonoBehaviour: 40 | m_ObjectHideFlags: 1 41 | m_PrefabParentObject: {fileID: 0} 42 | m_PrefabInternal: {fileID: 100100000} 43 | m_GameObject: {fileID: 120972} 44 | m_Enabled: 1 45 | m_EditorHideFlags: 0 46 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 47 | m_Name: 48 | m_EditorClassIdentifier: 49 | m_Material: {fileID: 0} 50 | m_Color: {r: 1, g: 1, b: 1, a: 1} 51 | m_RaycastTarget: 1 52 | m_OnCullStateChanged: 53 | m_PersistentCalls: 54 | m_Calls: [] 55 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 56 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 57 | m_Sprite: {fileID: 0} 58 | m_Type: 0 59 | m_PreserveAspect: 0 60 | m_FillCenter: 1 61 | m_FillMethod: 4 62 | m_FillAmount: 1 63 | m_FillClockwise: 1 64 | m_FillOrigin: 0 65 | --- !u!114 &11413704 66 | MonoBehaviour: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 120972} 71 | m_Enabled: 1 72 | m_EditorHideFlags: 0 73 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 74 | m_Name: 75 | m_EditorClassIdentifier: 76 | m_Navigation: 77 | m_Mode: 3 78 | m_SelectOnUp: {fileID: 0} 79 | m_SelectOnDown: {fileID: 0} 80 | m_SelectOnLeft: {fileID: 0} 81 | m_SelectOnRight: {fileID: 0} 82 | m_Transition: 1 83 | m_Colors: 84 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 85 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 86 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 87 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 88 | m_ColorMultiplier: 1 89 | m_FadeDuration: 0.1 90 | m_SpriteState: 91 | m_HighlightedSprite: {fileID: 0} 92 | m_PressedSprite: {fileID: 0} 93 | m_DisabledSprite: {fileID: 0} 94 | m_AnimationTriggers: 95 | m_NormalTrigger: Normal 96 | m_HighlightedTrigger: Highlighted 97 | m_PressedTrigger: Pressed 98 | m_DisabledTrigger: Disabled 99 | m_Interactable: 1 100 | m_TargetGraphic: {fileID: 11413600} 101 | m_OnClick: 102 | m_PersistentCalls: 103 | m_Calls: [] 104 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 105 | Culture=neutral, PublicKeyToken=null 106 | --- !u!114 &11415510 107 | MonoBehaviour: 108 | m_ObjectHideFlags: 1 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 100100000} 111 | m_GameObject: {fileID: 158350} 112 | m_Enabled: 1 113 | m_EditorHideFlags: 0 114 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 115 | m_Name: 116 | m_EditorClassIdentifier: 117 | m_Material: {fileID: 0} 118 | m_Color: {r: 0, g: 0, b: 0, a: 1} 119 | m_RaycastTarget: 1 120 | m_OnCullStateChanged: 121 | m_PersistentCalls: 122 | m_Calls: [] 123 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 124 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 125 | m_FontData: 126 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 127 | m_FontSize: 14 128 | m_FontStyle: 0 129 | m_BestFit: 0 130 | m_MinSize: 10 131 | m_MaxSize: 40 132 | m_Alignment: 4 133 | m_AlignByGeometry: 0 134 | m_RichText: 1 135 | m_HorizontalOverflow: 0 136 | m_VerticalOverflow: 0 137 | m_LineSpacing: 1 138 | m_Text: 'Category #1' 139 | --- !u!222 &22201782 140 | CanvasRenderer: 141 | m_ObjectHideFlags: 1 142 | m_PrefabParentObject: {fileID: 0} 143 | m_PrefabInternal: {fileID: 100100000} 144 | m_GameObject: {fileID: 158350} 145 | --- !u!222 &22212698 146 | CanvasRenderer: 147 | m_ObjectHideFlags: 1 148 | m_PrefabParentObject: {fileID: 0} 149 | m_PrefabInternal: {fileID: 100100000} 150 | m_GameObject: {fileID: 120972} 151 | --- !u!224 &22405166 152 | RectTransform: 153 | m_ObjectHideFlags: 1 154 | m_PrefabParentObject: {fileID: 0} 155 | m_PrefabInternal: {fileID: 100100000} 156 | m_GameObject: {fileID: 158350} 157 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 158 | m_LocalPosition: {x: 0, y: 0, z: 0} 159 | m_LocalScale: {x: 1, y: 1, z: 1} 160 | m_Children: [] 161 | m_Father: {fileID: 22481696} 162 | m_RootOrder: 0 163 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 164 | m_AnchorMin: {x: 0, y: 0} 165 | m_AnchorMax: {x: 1, y: 1} 166 | m_AnchoredPosition: {x: 0, y: 0} 167 | m_SizeDelta: {x: 0, y: 0} 168 | m_Pivot: {x: 0.5, y: 0.5} 169 | --- !u!224 &22481696 170 | RectTransform: 171 | m_ObjectHideFlags: 1 172 | m_PrefabParentObject: {fileID: 0} 173 | m_PrefabInternal: {fileID: 100100000} 174 | m_GameObject: {fileID: 120972} 175 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 176 | m_LocalPosition: {x: 0, y: 0, z: 0} 177 | m_LocalScale: {x: 1, y: 1, z: 1} 178 | m_Children: 179 | - {fileID: 22405166} 180 | m_Father: {fileID: 0} 181 | m_RootOrder: 0 182 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 183 | m_AnchorMin: {x: 0, y: 0} 184 | m_AnchorMax: {x: 0, y: 0} 185 | m_AnchoredPosition: {x: 0, y: 0} 186 | m_SizeDelta: {x: 0, y: 0} 187 | m_Pivot: {x: 0.5, y: 0.5} 188 | --- !u!1001 &100100000 189 | Prefab: 190 | m_ObjectHideFlags: 1 191 | serializedVersion: 2 192 | m_Modification: 193 | m_TransformParent: {fileID: 0} 194 | m_Modifications: [] 195 | m_RemovedComponents: [] 196 | m_ParentPrefab: {fileID: 0} 197 | m_RootGameObject: {fileID: 120972} 198 | m_IsPrefabParent: 1 199 | -------------------------------------------------------------------------------- /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/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/DebugPanel/Resources/ButtonItem.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &142562 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 5 9 | m_Component: 10 | - component: {fileID: 22462164} 11 | - component: {fileID: 22225342} 12 | - component: {fileID: 11495514} 13 | - component: {fileID: 11497570} 14 | - component: {fileID: 11458004} 15 | m_Layer: 0 16 | m_Name: ButtonItem 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!1 &196584 23 | GameObject: 24 | m_ObjectHideFlags: 0 25 | m_PrefabParentObject: {fileID: 0} 26 | m_PrefabInternal: {fileID: 100100000} 27 | serializedVersion: 5 28 | m_Component: 29 | - component: {fileID: 22428542} 30 | - component: {fileID: 22260236} 31 | - component: {fileID: 11484310} 32 | m_Layer: 0 33 | m_Name: Text 34 | m_TagString: Untagged 35 | m_Icon: {fileID: 0} 36 | m_NavMeshLayer: 0 37 | m_StaticEditorFlags: 0 38 | m_IsActive: 1 39 | --- !u!114 &11458004 40 | MonoBehaviour: 41 | m_ObjectHideFlags: 1 42 | m_PrefabParentObject: {fileID: 0} 43 | m_PrefabInternal: {fileID: 100100000} 44 | m_GameObject: {fileID: 142562} 45 | m_Enabled: 1 46 | m_EditorHideFlags: 0 47 | m_Script: {fileID: 1679637790, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 48 | m_Name: 49 | m_EditorClassIdentifier: 50 | m_IgnoreLayout: 0 51 | m_MinWidth: -1 52 | m_MinHeight: -1 53 | m_PreferredWidth: -1 54 | m_PreferredHeight: 50 55 | m_FlexibleWidth: -1 56 | m_FlexibleHeight: -1 57 | m_LayoutPriority: 1 58 | --- !u!114 &11484310 59 | MonoBehaviour: 60 | m_ObjectHideFlags: 1 61 | m_PrefabParentObject: {fileID: 0} 62 | m_PrefabInternal: {fileID: 100100000} 63 | m_GameObject: {fileID: 196584} 64 | m_Enabled: 1 65 | m_EditorHideFlags: 0 66 | m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 67 | m_Name: 68 | m_EditorClassIdentifier: 69 | m_Material: {fileID: 0} 70 | m_Color: {r: 0, g: 0, b: 0, a: 1} 71 | m_RaycastTarget: 1 72 | m_OnCullStateChanged: 73 | m_PersistentCalls: 74 | m_Calls: [] 75 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 76 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 77 | m_FontData: 78 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 79 | m_FontSize: 14 80 | m_FontStyle: 0 81 | m_BestFit: 0 82 | m_MinSize: 10 83 | m_MaxSize: 40 84 | m_Alignment: 4 85 | m_AlignByGeometry: 0 86 | m_RichText: 1 87 | m_HorizontalOverflow: 0 88 | m_VerticalOverflow: 0 89 | m_LineSpacing: 1 90 | m_Text: Button 91 | --- !u!114 &11495514 92 | MonoBehaviour: 93 | m_ObjectHideFlags: 1 94 | m_PrefabParentObject: {fileID: 0} 95 | m_PrefabInternal: {fileID: 100100000} 96 | m_GameObject: {fileID: 142562} 97 | m_Enabled: 1 98 | m_EditorHideFlags: 0 99 | m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 100 | m_Name: 101 | m_EditorClassIdentifier: 102 | m_Material: {fileID: 0} 103 | m_Color: {r: 1, g: 1, b: 1, a: 1} 104 | m_RaycastTarget: 1 105 | m_OnCullStateChanged: 106 | m_PersistentCalls: 107 | m_Calls: [] 108 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 109 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 110 | m_Sprite: {fileID: 0} 111 | m_Type: 1 112 | m_PreserveAspect: 0 113 | m_FillCenter: 1 114 | m_FillMethod: 4 115 | m_FillAmount: 1 116 | m_FillClockwise: 1 117 | m_FillOrigin: 0 118 | --- !u!114 &11497570 119 | MonoBehaviour: 120 | m_ObjectHideFlags: 1 121 | m_PrefabParentObject: {fileID: 0} 122 | m_PrefabInternal: {fileID: 100100000} 123 | m_GameObject: {fileID: 142562} 124 | m_Enabled: 1 125 | m_EditorHideFlags: 0 126 | m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} 127 | m_Name: 128 | m_EditorClassIdentifier: 129 | m_Navigation: 130 | m_Mode: 3 131 | m_SelectOnUp: {fileID: 0} 132 | m_SelectOnDown: {fileID: 0} 133 | m_SelectOnLeft: {fileID: 0} 134 | m_SelectOnRight: {fileID: 0} 135 | m_Transition: 1 136 | m_Colors: 137 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 138 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 139 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 140 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 141 | m_ColorMultiplier: 1 142 | m_FadeDuration: 0.1 143 | m_SpriteState: 144 | m_HighlightedSprite: {fileID: 0} 145 | m_PressedSprite: {fileID: 0} 146 | m_DisabledSprite: {fileID: 0} 147 | m_AnimationTriggers: 148 | m_NormalTrigger: Normal 149 | m_HighlightedTrigger: Highlighted 150 | m_PressedTrigger: Pressed 151 | m_DisabledTrigger: Disabled 152 | m_Interactable: 1 153 | m_TargetGraphic: {fileID: 11495514} 154 | m_OnClick: 155 | m_PersistentCalls: 156 | m_Calls: [] 157 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 158 | Culture=neutral, PublicKeyToken=null 159 | --- !u!222 &22225342 160 | CanvasRenderer: 161 | m_ObjectHideFlags: 1 162 | m_PrefabParentObject: {fileID: 0} 163 | m_PrefabInternal: {fileID: 100100000} 164 | m_GameObject: {fileID: 142562} 165 | --- !u!222 &22260236 166 | CanvasRenderer: 167 | m_ObjectHideFlags: 1 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 100100000} 170 | m_GameObject: {fileID: 196584} 171 | --- !u!224 &22428542 172 | RectTransform: 173 | m_ObjectHideFlags: 1 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 100100000} 176 | m_GameObject: {fileID: 196584} 177 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 178 | m_LocalPosition: {x: 0, y: 0, z: 0} 179 | m_LocalScale: {x: 1, y: 1, z: 1} 180 | m_Children: [] 181 | m_Father: {fileID: 22462164} 182 | m_RootOrder: 0 183 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 184 | m_AnchorMin: {x: 0, y: 0} 185 | m_AnchorMax: {x: 1, y: 1} 186 | m_AnchoredPosition: {x: 0, y: 0} 187 | m_SizeDelta: {x: 0, y: 0} 188 | m_Pivot: {x: 0.5, y: 0.5} 189 | --- !u!224 &22462164 190 | RectTransform: 191 | m_ObjectHideFlags: 1 192 | m_PrefabParentObject: {fileID: 0} 193 | m_PrefabInternal: {fileID: 100100000} 194 | m_GameObject: {fileID: 142562} 195 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 196 | m_LocalPosition: {x: 0, y: 0, z: 0} 197 | m_LocalScale: {x: 1, y: 1, z: 1} 198 | m_Children: 199 | - {fileID: 22428542} 200 | m_Father: {fileID: 0} 201 | m_RootOrder: 0 202 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 203 | m_AnchorMin: {x: 0, y: 0} 204 | m_AnchorMax: {x: 0, y: 0} 205 | m_AnchoredPosition: {x: 0, y: 0} 206 | m_SizeDelta: {x: 0, y: 0} 207 | m_Pivot: {x: 0.5, y: 0.5} 208 | --- !u!1001 &100100000 209 | Prefab: 210 | m_ObjectHideFlags: 1 211 | serializedVersion: 2 212 | m_Modification: 213 | m_TransformParent: {fileID: 0} 214 | m_Modifications: [] 215 | m_RemovedComponents: [] 216 | m_ParentPrefab: {fileID: 0} 217 | m_RootGameObject: {fileID: 142562} 218 | m_IsPrefabParent: 1 219 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /Assets/Yurowm/DebugPanel/Editor/DebugPanelView.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using UnityEditor; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace Yurowm.DebugTools { 10 | public class DebugPanelView : EditorWindow { 11 | static DebugPanelView instance = null; 12 | 13 | [MenuItem("Window/DebugTools/Debug Panel")] 14 | public static DebugPanelView CreateBerryPanel() { 15 | DebugPanelView 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 | float messageHeight = 20; 28 | 29 | void OnEnable() { 30 | instance = this; 31 | titleContent.text = "Debug Panel"; 32 | } 33 | 34 | GUIStyle messageNameStyle = null; 35 | GUIStyle messageValueStyle = null; 36 | GUIStyle categoryStyle = null; 37 | GUIStyle outputBackgroundStyle = null; 38 | Texture2D blackTexture = null; 39 | 40 | void InitializeStyles() { 41 | blackTexture = new Texture2D(1, 1); 42 | blackTexture.SetPixel(0, 0, Color.black); 43 | blackTexture.Apply(); 44 | 45 | messageNameStyle = new GUIStyle(EditorStyles.label); 46 | messageNameStyle.normal.textColor = Color.white; 47 | messageNameStyle.alignment = TextAnchor.MiddleLeft; 48 | messageNameStyle.clipping = TextClipping.Clip; 49 | messageNameStyle.hover = messageNameStyle.normal; 50 | messageNameStyle.active = messageNameStyle.normal; 51 | messageNameStyle.focused = messageNameStyle.normal; 52 | messageNameStyle.fontSize = 12; 53 | 54 | messageValueStyle = new GUIStyle(messageNameStyle); 55 | messageValueStyle.fontStyle = FontStyle.Bold; 56 | 57 | categoryStyle = new GUIStyle(EditorStyles.miniButton); 58 | categoryStyle.normal.background = Texture2D.whiteTexture; 59 | categoryStyle.normal.textColor = Color.black; 60 | categoryStyle.alignment = TextAnchor.MiddleLeft; 61 | categoryStyle.clipping = TextClipping.Clip; 62 | categoryStyle.hover = categoryStyle.normal; 63 | categoryStyle.active = categoryStyle.normal; 64 | categoryStyle.focused = categoryStyle.normal; 65 | categoryStyle.fontSize = 12; 66 | 67 | outputBackgroundStyle = new GUIStyle(EditorStyles.textArea); 68 | outputBackgroundStyle.normal.background = blackTexture; 69 | outputBackgroundStyle.border = new RectOffset(); 70 | outputBackgroundStyle.margin = new RectOffset(); 71 | outputBackgroundStyle.padding = new RectOffset(); 72 | 73 | messageHeight = messageNameStyle.CalcHeight(new GUIContent("Test"), 100); 74 | } 75 | 76 | void OnGUI() { 77 | if (blackTexture == null) 78 | InitializeStyles(); 79 | 80 | DrawToolbar(); 81 | DrawLog(); 82 | } 83 | 84 | void DrawToolbar() { 85 | EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true)); 86 | 87 | if (EditorApplication.isPlaying) { 88 | if (GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Width(50))) DebugPanel.Clear(); 89 | if (GUILayout.Button("Show all", EditorStyles.toolbarButton, GUILayout.Width(60))) DebugPanel.Instance.showAllButton.onClick.Invoke(); 90 | if (GUILayout.Button("Hide all", EditorStyles.toolbarButton, GUILayout.Width(60))) DebugPanel.Instance.hideAllButton.onClick.Invoke(); 91 | } 92 | 93 | GUILayout.FlexibleSpace(); 94 | 95 | EditorGUILayout.EndHorizontal(); 96 | } 97 | 98 | const string delegatesCategory = "Delegates"; 99 | Vector2 scrollPosition = new Vector2(); 100 | void DrawLog() { 101 | 102 | EditorGUILayout.BeginVertical(outputBackgroundStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 103 | if (EditorApplication.isPlaying) { 104 | scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true)); 105 | foreach (var category in DebugPanel.categories.Values) { 106 | GUI.color = CategoryColor(category.name); 107 | if (GUILayout.Button(CategoryToggle(category.state) + category.name, categoryStyle, GUILayout.ExpandWidth(true))) 108 | category.state = !category.state; 109 | if (category.state) { 110 | if (category.name.Equals(delegatesCategory)) { 111 | foreach (var button in DebugPanel.buttons) 112 | DrawDelegateMessage(button); 113 | } else 114 | foreach (var message in DebugPanel.messages.Values) { 115 | if (message.category.Equals(category.name)) 116 | DrawMessage(message); 117 | } 118 | } 119 | } 120 | GUI.color = Color.white; 121 | EditorGUILayout.EndScrollView(); 122 | Repaint(); 123 | } else 124 | EditorGUILayout.HelpBox("Debug Panel works only in Play mode yet.", MessageType.Warning); 125 | EditorGUILayout.EndVertical(); 126 | } 127 | 128 | Color errorColor = new Color(1f, .5f, .5f); 129 | Color systemColor = new Color(.5f, 1f, .5f); 130 | Color delegateColor = new Color(.5f, 1f, 1f); 131 | Color warningColor = new Color(1f, 1f, .3f); 132 | Color logColor = new Color(.5f, .5f, .5f); 133 | Color defaultColor = Color.white; 134 | 135 | Color CategoryColor(string category) { 136 | switch (category) { 137 | case "Error": return errorColor; 138 | case "System": return systemColor; 139 | case "Delegates": return delegateColor; 140 | case "Warning": return delegateColor; 141 | case "Log": return logColor; 142 | default: return defaultColor; 143 | } 144 | } 145 | 146 | const string categoryMinus = "− "; 147 | const string categoryPlus = "+ "; 148 | string CategoryToggle(bool value) { 149 | return value ? categoryMinus : categoryPlus; 150 | } 151 | 152 | void DrawMessage(DebugPanel.Message message) { 153 | var mRect = GetMessageRect(); 154 | 155 | var rect = new Rect(mRect.x, mRect.y, 120, mRect.height); 156 | GUI.Label(rect, message.name, messageNameStyle); 157 | 158 | rect.x += rect.width; 159 | rect.width = mRect.width - rect.width; 160 | 161 | GUI.Label(rect, message.text, messageValueStyle); 162 | } 163 | 164 | void DrawDelegateMessage(KeyValuePair pair) { 165 | var mRect = GetMessageRect(); 166 | 167 | var rect = new Rect(mRect.x, mRect.y, 120, mRect.height); 168 | GUI.Label(rect, pair.Key, messageNameStyle); 169 | 170 | rect.x += rect.width; 171 | rect.width = 70; 172 | 173 | if (GUI.Button(rect, "> Invoke", categoryStyle)) 174 | pair.Value.onClick.Invoke(); 175 | } 176 | 177 | Rect GetMessageRect() { 178 | var rect = EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.Height(messageHeight)); 179 | rect.x += messageHeight; 180 | rect.width -= messageHeight; 181 | return rect; 182 | } 183 | } 184 | } -------------------------------------------------------------------------------- /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/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/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