├── .gitattributes ├── .gitignore ├── 5.6 ├── Test │ ├── Assets │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── UnityEditor.Facebook.Extensions.dll │ │ │ ├── UnityEditor.Facebook.Extensions.dll.mdb │ │ │ ├── UnityEditor.Facebook.Extensions.dll.mdb.meta │ │ │ ├── UnityEditor.Facebook.Extensions.dll.meta │ │ │ ├── VisualStudioFileOpenTool.exe │ │ │ └── VisualStudioFileOpenTool.exe.meta │ │ ├── NewBehaviourScript.cs │ │ └── NewBehaviourScript.cs.meta │ └── ProjectSettings │ │ ├── AudioManager.asset │ │ ├── ClusterInputManager.asset │ │ ├── DynamicsManager.asset │ │ ├── EditorBuildSettings.asset │ │ ├── EditorSettings.asset │ │ ├── GraphicsSettings.asset │ │ ├── InputManager.asset │ │ ├── NavMeshAreas.asset │ │ ├── NetworkManager.asset │ │ ├── Physics2DSettings.asset │ │ ├── ProjectSettings.asset │ │ ├── ProjectVersion.txt │ │ ├── QualitySettings.asset │ │ ├── TagManager.asset │ │ ├── TimeManager.asset │ │ └── UnityConnectSettings.asset └── UnityEditor.Facebook.Extensions │ ├── UnityEditor.Facebook.Extensions.sln │ └── UnityEditor.Facebook.Extensions │ ├── .gitignore │ ├── Properties │ └── AssemblyInfo.cs │ └── UnityEditor.Facebook.Extensions.csproj ├── Assets ├── DLLTest.dll ├── DLLTest.dll.mdb ├── DLLTest.dll.mdb.meta ├── DLLTest.dll.meta ├── NewBehaviourScript.cs └── NewBehaviourScript.cs.meta ├── DLLTest ├── DLLTest │ ├── Class1.cs │ └── Properties │ │ └── AssemblyInfo.cs └── screenshot.png ├── LICENSE ├── Packages └── manifest.json ├── PackagesCustom └── com.wuhuan.consoletiny │ ├── Editor.meta │ ├── Editor │ ├── ConsoleWindow.cs │ ├── ConsoleWindow.cs.meta │ ├── LogEntries.cs │ ├── LogEntries.cs.meta │ ├── ScriptAssetOpener.cs │ ├── ScriptAssetOpener.cs.meta │ ├── UnityEditor.Lumin.Extensions.asmdef │ ├── UnityEditor.Lumin.Extensions.asmdef.meta │ ├── VisualStudioFileOpenTool.exe │ └── VisualStudioFileOpenTool.exe.meta │ ├── package.json │ └── package.json.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset └── VFXManager.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | [Bb]uild/ 5 | [Bb]uilds/ 6 | Assets/AssetStoreTools* 7 | 8 | # Visual Studio cache directory 9 | .vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | *.opendb 26 | 27 | # Unity3D generated meta files 28 | *.pidb.meta 29 | *.pdb.meta 30 | 31 | # Unity3D Generated File On Crash Reports 32 | sysinfo.txt 33 | 34 | # Builds 35 | *.apk 36 | *.unitypackage 37 | /DLLTest/DLLTest/bin/ 38 | /2017/ 39 | -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42c715055f077854abde09d02ba132d3 3 | folderAsset: yes 4 | timeCreated: 1561881144 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll.mdb -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll.mdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5110457f6db91d644be911c67976dced 3 | timeCreated: 1564209875 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/UnityEditor.Facebook.Extensions.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29ac13ea0b0c36442823660f8a912225 3 | timeCreated: 1561881145 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | Any: 15 | second: 16 | enabled: 0 17 | settings: {} 18 | data: 19 | first: 20 | Editor: Editor 21 | second: 22 | enabled: 1 23 | settings: 24 | DefaultValueInitialized: true 25 | data: 26 | first: 27 | Windows Store Apps: WindowsStoreApps 28 | second: 29 | enabled: 0 30 | settings: 31 | CPU: AnyCPU 32 | userData: 33 | assetBundleName: 34 | assetBundleVariant: 35 | -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/VisualStudioFileOpenTool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/Assets/Editor/VisualStudioFileOpenTool.exe -------------------------------------------------------------------------------- /5.6/Test/Assets/Editor/VisualStudioFileOpenTool.exe.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbd9db6a4a230a84980527a3ca9a04bf 3 | timeCreated: 1571466232 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /5.6/Test/Assets/NewBehaviourScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | public class NewBehaviourScript : MonoBehaviour 5 | { 6 | [ContextMenu("test")] 7 | public void Test() 8 | { 9 | Debug.Log("abcabc"); 10 | Debug.Log("a222bcabc"); 11 | Debug.Log("abcabc"); 12 | Debug.LogError("Opens asset in an external editor, \ntexture application or modelling tool depending on what type of asset it is. \nIf it is a text file, lineNumber instructs the text editor to go to that line. Returns true if asset opened successfully."); 13 | Debug.Log("abcabc"); 14 | Debug.LogWarning("Description"); 15 | Test1("aaaa1"); 16 | } 17 | 18 | private void Test1(string ta) 19 | { 20 | Test2(); 21 | } 22 | 23 | private void Test2() 24 | { 25 | Debug.Log("more"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /5.6/Test/Assets/NewBehaviourScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8de7812a89504d4408ce15a2a620482a 3 | timeCreated: 1561877708 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.6f2 2 | -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /5.6/Test/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/5.6/Test/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /5.6/UnityEditor.Facebook.Extensions/UnityEditor.Facebook.Extensions.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.705 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnityEditor.Facebook.Extensions", "UnityEditor.Facebook.Extensions\UnityEditor.Facebook.Extensions.csproj", "{957ACDAF-F583-49FB-9617-176E2D814715}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {957ACDAF-F583-49FB-9617-176E2D814715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {957ACDAF-F583-49FB-9617-176E2D814715}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {957ACDAF-F583-49FB-9617-176E2D814715}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {957ACDAF-F583-49FB-9617-176E2D814715}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {0DA5454B-7B83-4F29-BA7F-7408A89863C9} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /5.6/UnityEditor.Facebook.Extensions/UnityEditor.Facebook.Extensions/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /5.6/UnityEditor.Facebook.Extensions/UnityEditor.Facebook.Extensions/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("UnityEditor.Facebook.Extensions")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("UnityEditor.Facebook.Extensions")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("957acdaf-f583-49fb-9617-176e2d814715")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /5.6/UnityEditor.Facebook.Extensions/UnityEditor.Facebook.Extensions/UnityEditor.Facebook.Extensions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {957ACDAF-F583-49FB-9617-176E2D814715} 8 | Library 9 | Properties 10 | UnityEditor.Facebook.Extensions 11 | UnityEditor.Facebook.Extensions 12 | v3.5 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | C:\Program Files\Unity5.6\Editor\Data\Managed\UnityEditor.dll 42 | 43 | 44 | C:\Program Files\Unity5.6\Editor\Data\Managed\UnityEngine.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | xcopy /e /r /y $(TargetPath) $(SolutionDir)\..\Test\Assets\Editor 56 | $(TargetDir)pdb2mdb.exe $(TargetPath) 57 | xcopy /e /r /y $(TargetDir)$(TargetFileName).mdb $(SolutionDir)\..\Test\Assets\Editor 58 | 59 | -------------------------------------------------------------------------------- /Assets/DLLTest.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/Assets/DLLTest.dll -------------------------------------------------------------------------------- /Assets/DLLTest.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/Assets/DLLTest.dll.mdb -------------------------------------------------------------------------------- /Assets/DLLTest.dll.mdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95d93ada89bb10748ab32cd93935a5cd 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DLLTest.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bdd68f2d6ff23a4b98a7aff54948b38 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/NewBehaviourScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | public class NewBehaviourScript : MonoBehaviour 5 | { 6 | [ContextMenu("test")] 7 | public void Test() 8 | { 9 | Debug.Log("abcabc"); 10 | Debug.Log("a222bcabc"); 11 | Debug.Log("abcabc"); 12 | Debug.LogError("Opens asset in an external editor, \ntexture application or modelling tool depending on what type of asset it is. \nIf it is a text file, lineNumber instructs the text editor to go to that line. Returns true if asset opened successfully."); 13 | Debug.Log("abcabc"); 14 | Debug.LogWarning("Description"); 15 | Test1("aaaa11"); 16 | } 17 | 18 | [ContextMenu("test2")] 19 | public void Test22() 20 | { 21 | Debug.Log("We are <>usually"); 22 | Debug.Log("We are usually not amused error"); 23 | Debug.Log("We are usually not amused"); 24 | Debug.Log("We are usually not amused"); 25 | //Debug.Log("We are usually not amused."); 26 | Debug.Log("We are usually not amused."); 27 | Debug.Log("We are usually not amused."); 28 | Debug.Log("We are usually not amused."); 29 | } 30 | 31 | private void Test1(string ta) 32 | { 33 | Test2(); 34 | //Test3(); 35 | } 36 | 37 | private void Test2() 38 | { 39 | Debug.Log("more"); 40 | string a = "aaaa"; 41 | a.LastIndexOf('.', 8, 20); 42 | } 43 | 44 | private void Test3() 45 | { 46 | for (int i = 0; i < 9999; i++) 47 | { 48 | Debug.LogError("A variant of Debug.Log that logs an error message to the console."); 49 | Debug.Log("Assert a condition and logs an error message to the Unity console on failure"); 50 | Debug.LogWarning("Class containing methods to ease debugging while developing a game"); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Assets/NewBehaviourScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f885451c4a569fd4793504752477aad0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /DLLTest/DLLTest/Class1.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace DLLTest 4 | { 5 | public class Test : MonoBehaviour 6 | { 7 | [ContextMenu("test0")] 8 | public void Test0() 9 | { 10 | Debug.Log("DLLabcabc"); 11 | Debug.LogError("DLLabcabc22222222222222"); 12 | Test1(); 13 | } 14 | 15 | private void Test1() 16 | { 17 | Test2(); 18 | } 19 | 20 | private void Test2() 21 | { 22 | Debug.Log("DLLmore"); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /DLLTest/DLLTest/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("DLLTest")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("DLLTest")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("93be0b86-5ee8-4d4c-8e88-b4f4409d9e9f")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, 33 | // 方法是按如下所示使用“*”: : 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /DLLTest/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/DLLTest/screenshot.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 WuHuan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.2.2", 5 | "com.unity.collab-proxy": "1.2.15", 6 | "com.unity.package-manager-ui": "2.0.7", 7 | "com.unity.purchasing": "2.0.3", 8 | "com.unity.textmeshpro": "1.4.1", 9 | "com.wuhuan.consoletiny": "file:../PackagesCustom/com.wuhuan.consoletiny", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.assetbundle": "1.0.0", 13 | "com.unity.modules.audio": "1.0.0", 14 | "com.unity.modules.cloth": "1.0.0", 15 | "com.unity.modules.director": "1.0.0", 16 | "com.unity.modules.imageconversion": "1.0.0", 17 | "com.unity.modules.imgui": "1.0.0", 18 | "com.unity.modules.jsonserialize": "1.0.0", 19 | "com.unity.modules.particlesystem": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0", 21 | "com.unity.modules.physics2d": "1.0.0", 22 | "com.unity.modules.screencapture": "1.0.0", 23 | "com.unity.modules.terrain": "1.0.0", 24 | "com.unity.modules.terrainphysics": "1.0.0", 25 | "com.unity.modules.tilemap": "1.0.0", 26 | "com.unity.modules.ui": "1.0.0", 27 | "com.unity.modules.uielements": "1.0.0", 28 | "com.unity.modules.umbra": "1.0.0", 29 | "com.unity.modules.unityanalytics": "1.0.0", 30 | "com.unity.modules.unitywebrequest": "1.0.0", 31 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 32 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 33 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 34 | "com.unity.modules.unitywebrequestwww": "1.0.0", 35 | "com.unity.modules.vehicles": "1.0.0", 36 | "com.unity.modules.video": "1.0.0", 37 | "com.unity.modules.vr": "1.0.0", 38 | "com.unity.modules.wind": "1.0.0", 39 | "com.unity.modules.xr": "1.0.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d842c81d7797ca84aa3b41f2d585826e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/ConsoleWindow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using UnityEngine; 4 | using UnityEditor; 5 | #if UNITY_2020_1_OR_NEWER 6 | using UnityEngine.Networking.PlayerConnection; 7 | using UnityEditor.Networking.PlayerConnection; 8 | #elif UNITY_2018_3_OR_NEWER 9 | using UnityEngine.Experimental.Networking.PlayerConnection; 10 | using UnityEditor.Experimental.Networking.PlayerConnection; 11 | using ConnectionGUILayout = UnityEditor.Experimental.Networking.PlayerConnection.EditorGUILayout; 12 | #endif 13 | using EditorGUI = UnityEditor.EditorGUI; 14 | using EditorGUILayout = UnityEditor.EditorGUILayout; 15 | using EditorGUIUtility = UnityEditor.EditorGUIUtility; 16 | #if UNITY_2017_1_OR_NEWER 17 | using CoreLog = UnityEditor; 18 | #else 19 | using CoreLog = UnityEditorInternal; 20 | #endif 21 | 22 | namespace ConsoleTiny 23 | { 24 | [EditorWindowTitle(title = "Console", useTypeNameAsIconName = true)] 25 | public class ConsoleWindow : EditorWindow, IHasCustomMenu 26 | { 27 | [MenuItem("Window/General/ConsoleT %#t", false, 7)] 28 | static void ShowConsole() 29 | { 30 | EditorWindow.GetWindow(); 31 | } 32 | 33 | //TODO: move this out of here 34 | internal class Constants 35 | { 36 | private static bool ms_Loaded; 37 | private static int ms_logStyleLineCount; 38 | public static GUIStyle Box; 39 | public static GUIStyle MiniButton; 40 | public static GUIStyle LogStyle; 41 | public static GUIStyle WarningStyle; 42 | public static GUIStyle ErrorStyle; 43 | public static GUIStyle IconLogStyle; 44 | public static GUIStyle IconWarningStyle; 45 | public static GUIStyle IconErrorStyle; 46 | public static GUIStyle EvenBackground; 47 | public static GUIStyle OddBackground; 48 | public static GUIStyle MessageStyle; 49 | public static GUIStyle StatusError; 50 | public static GUIStyle StatusWarn; 51 | public static GUIStyle StatusLog; 52 | public static GUIStyle Toolbar; 53 | public static GUIStyle CountBadge; 54 | public static GUIStyle LogSmallStyle; 55 | public static GUIStyle WarningSmallStyle; 56 | public static GUIStyle ErrorSmallStyle; 57 | public static GUIStyle IconLogSmallStyle; 58 | public static GUIStyle IconWarningSmallStyle; 59 | public static GUIStyle IconErrorSmallStyle; 60 | public static readonly string ClearLabel = ("Clear"); 61 | public static readonly string ClearOnPlayLabel = ("Clear on Play"); 62 | public static readonly string ErrorPauseLabel = ("Error Pause"); 63 | public static readonly string CollapseLabel = ("Collapse"); 64 | public static readonly string StopForAssertLabel = ("Stop for Assert"); 65 | public static readonly string StopForErrorLabel = ("Stop for Error"); 66 | public static readonly string ClearOnBuildLabel = ("Clear on Build"); 67 | public static readonly string FirstErrorLabel = ("First Error"); 68 | public static readonly string CustomFiltersLabel = ("Custom Filters"); 69 | public static readonly string ImportWatchingLabel = ("Import Watching"); 70 | 71 | public static int LogStyleLineCount 72 | { 73 | get { return ms_logStyleLineCount; } 74 | set 75 | { 76 | ms_logStyleLineCount = value; 77 | LogEntries.wrapped.numberOfLines = value; 78 | 79 | // If Constants hasn't been initialized yet we just skip this for now 80 | // and let Init() call this for us in a bit. 81 | if (!ms_Loaded) 82 | return; 83 | UpdateLogStyleFixedHeights(); 84 | } 85 | } 86 | 87 | public static void Init() 88 | { 89 | if (ms_Loaded) 90 | return; 91 | ms_Loaded = true; 92 | Box = "CN Box"; 93 | 94 | 95 | MiniButton = "ToolbarButton"; 96 | Toolbar = "Toolbar"; 97 | LogStyle = "CN EntryInfo"; 98 | WarningStyle = "CN EntryWarn"; 99 | ErrorStyle = "CN EntryError"; 100 | 101 | EvenBackground = "CN EntryBackEven"; 102 | OddBackground = "CN EntryBackodd"; 103 | MessageStyle = "CN Message"; 104 | StatusError = "CN StatusError"; 105 | StatusWarn = "CN StatusWarn"; 106 | StatusLog = "CN StatusInfo"; 107 | CountBadge = "CN CountBadge"; 108 | MessageStyle = new GUIStyle(MessageStyle); 109 | MessageStyle.onNormal.textColor = MessageStyle.active.textColor; 110 | MessageStyle.padding.top = 0; 111 | MessageStyle.padding.bottom = 0; 112 | var selectedStyle = new GUIStyle("MeTransitionSelect"); 113 | MessageStyle.onNormal.background = selectedStyle.normal.background; 114 | 115 | bool isProSkin = EditorGUIUtility.isProSkin; 116 | LogEntries.EntryWrapped.Constants.colorNamespace = isProSkin ? "6A87A7" : "66677E"; 117 | LogEntries.EntryWrapped.Constants.colorClass = isProSkin ? "1A7ECD" : "0072A0"; 118 | LogEntries.EntryWrapped.Constants.colorMethod = isProSkin ? "0D9DDC" : "335B89"; 119 | LogEntries.EntryWrapped.Constants.colorParameters = isProSkin ? "4F7F9F" : "4C5B72"; 120 | LogEntries.EntryWrapped.Constants.colorPath = isProSkin ? "375E68" : "7F8B90"; 121 | LogEntries.EntryWrapped.Constants.colorFilename = isProSkin ? "4A6E8A" : "6285A1"; 122 | LogEntries.EntryWrapped.Constants.colorNamespaceAlpha = isProSkin ? "4E5B6A" : "87878F"; 123 | LogEntries.EntryWrapped.Constants.colorClassAlpha = isProSkin ? "2A577B" : "628B9B"; 124 | LogEntries.EntryWrapped.Constants.colorMethodAlpha = isProSkin ? "246581" : "748393"; 125 | LogEntries.EntryWrapped.Constants.colorParametersAlpha = isProSkin ? "425766" : "7D838B"; 126 | LogEntries.EntryWrapped.Constants.colorPathAlpha = isProSkin ? "375860" : "8E989D"; 127 | LogEntries.EntryWrapped.Constants.colorFilenameAlpha = isProSkin ? "4A6E8A" : "6285A1"; 128 | 129 | #if !UNITY_2017_1_OR_NEWER 130 | IconLogStyle = "CN EntryInfo"; 131 | IconWarningStyle = "CN EntryWarn"; 132 | IconErrorStyle = "CN EntryError"; 133 | LogSmallStyle = new GUIStyle("CN EntryInfo"); 134 | WarningSmallStyle = new GUIStyle("CN EntryWarn"); 135 | ErrorSmallStyle = new GUIStyle("CN EntryError"); 136 | IconLogSmallStyle = new GUIStyle("CN EntryInfo"); 137 | IconWarningSmallStyle = new GUIStyle("CN EntryWarn"); 138 | IconErrorSmallStyle = new GUIStyle("CN EntryError"); 139 | LogSmallStyle.normal.background = null; LogSmallStyle.onNormal.background = null; 140 | WarningSmallStyle.normal.background = null; WarningSmallStyle.onNormal.background = null; 141 | ErrorSmallStyle.normal.background = null; ErrorSmallStyle.onNormal.background = null; 142 | IconLogSmallStyle.normal.background = null; IconLogSmallStyle.onNormal.background = null; 143 | IconWarningSmallStyle.normal.background = null; IconWarningSmallStyle.onNormal.background = null; 144 | IconErrorSmallStyle.normal.background = null; IconErrorSmallStyle.onNormal.background = null; 145 | #else 146 | IconLogStyle = "CN EntryInfoIcon"; 147 | IconWarningStyle = "CN EntryWarnIcon"; 148 | IconErrorStyle = "CN EntryErrorIcon"; 149 | LogSmallStyle = "CN EntryInfoSmall"; 150 | WarningSmallStyle = "CN EntryWarnSmall"; 151 | ErrorSmallStyle = "CN EntryErrorSmall"; 152 | IconLogSmallStyle = "CN EntryInfoIconSmall"; 153 | IconWarningSmallStyle = "CN EntryWarnIconSmall"; 154 | IconErrorSmallStyle = "CN EntryErrorIconSmall"; 155 | #endif 156 | 157 | // If the console window isn't open OnEnable() won't trigger so it will end up with 0 lines, 158 | // so we always make sure we read it up when we initialize here. 159 | LogStyleLineCount = EditorPrefs.GetInt("ConsoleWindowLogLineCount", 2); 160 | } 161 | 162 | private static void UpdateLogStyleFixedHeights() 163 | { 164 | #if UNITY_2017_1_OR_NEWER 165 | // Whenever we change the line height count or the styles are set we need to update the fixed height 166 | // of the following GuiStyles so the entries do not get cropped incorrectly. 167 | ErrorStyle.fixedHeight = (LogStyleLineCount * ErrorStyle.lineHeight) + ErrorStyle.border.top; 168 | WarningStyle.fixedHeight = (LogStyleLineCount * WarningStyle.lineHeight) + WarningStyle.border.top; 169 | LogStyle.fixedHeight = (LogStyleLineCount * LogStyle.lineHeight) + LogStyle.border.top; 170 | #endif 171 | } 172 | } 173 | 174 | int m_LineHeight; 175 | int m_BorderHeight; 176 | 177 | bool m_HasUpdatedGuiStyles; 178 | 179 | ListViewState m_ListView; 180 | ListViewState m_ListViewMessage; 181 | private int m_StacktraceLineContextClickRow; 182 | private int m_ActiveInstanceID = 0; 183 | bool m_DevBuild; 184 | private string[] m_SearchHistory = new[] { "" }; 185 | private double m_NextRepaint = double.MaxValue; 186 | 187 | SplitterState spl = new SplitterState(new float[] { 70, 30 }, new int[] { 32, 32 }, null); 188 | 189 | static bool ms_LoadedIcons = false; 190 | static internal Texture2D iconInfo, iconWarn, iconError; 191 | static internal Texture2D iconInfoSmall, iconWarnSmall, iconErrorSmall, iconFirstErrorSmall; 192 | static internal Texture2D iconInfoMono, iconWarnMono, iconErrorMono, iconFirstErrorMono, iconCustomFiltersMono; 193 | static internal Texture2D[] iconCustomFiltersSmalls; 194 | 195 | int ms_LVHeight = 0; 196 | 197 | #if UNITY_2018_3_OR_NEWER 198 | class ConsoleAttachToPlayerState : GeneralConnectionState 199 | { 200 | static class Content 201 | { 202 | public static GUIContent PlayerLogging = EditorGUIUtility.TrTextContent("Player Logging"); 203 | public static GUIContent FullLog = EditorGUIUtility.TrTextContent("Full Log (Developer Mode Only)"); 204 | } 205 | 206 | public ConsoleAttachToPlayerState(EditorWindow parentWindow, Action connectedCallback = null) : base(parentWindow, connectedCallback) 207 | { 208 | } 209 | 210 | bool IsConnected() 211 | { 212 | return PlayerConnectionLogReceiver.instance.State != PlayerConnectionLogReceiver.ConnectionState.Disconnected; 213 | } 214 | 215 | void PlayerLoggingOptionSelected() 216 | { 217 | PlayerConnectionLogReceiver.instance.State = IsConnected() ? PlayerConnectionLogReceiver.ConnectionState.Disconnected : PlayerConnectionLogReceiver.ConnectionState.CleanLog; 218 | } 219 | 220 | bool IsLoggingFullLog() 221 | { 222 | return PlayerConnectionLogReceiver.instance.State == PlayerConnectionLogReceiver.ConnectionState.FullLog; 223 | } 224 | 225 | void FullLogOptionSelected() 226 | { 227 | PlayerConnectionLogReceiver.instance.State = IsLoggingFullLog() ? PlayerConnectionLogReceiver.ConnectionState.CleanLog : PlayerConnectionLogReceiver.ConnectionState.FullLog; 228 | } 229 | 230 | public override void AddItemsToMenu(GenericMenu menu, Rect position) 231 | { 232 | // option to turn logging and the connection on or of 233 | menu.AddItem(Content.PlayerLogging, IsConnected(), PlayerLoggingOptionSelected); 234 | if (IsConnected()) 235 | { 236 | // All other options but the first are only available if logging is enabled 237 | menu.AddItem(Content.FullLog, IsLoggingFullLog(), FullLogOptionSelected); 238 | menu.AddSeparator(""); 239 | base.AddItemsToMenu(menu, position); 240 | } 241 | } 242 | } 243 | 244 | IConnectionState m_ConsoleAttachToPlayerState; 245 | #endif 246 | 247 | enum ConsoleFlags 248 | { 249 | Collapse = 1 << 0, 250 | ClearOnPlay = 1 << 1, 251 | ErrorPause = 1 << 2, 252 | Verbose = 1 << 3, 253 | StopForAssert = 1 << 4, 254 | StopForError = 1 << 5, 255 | Autoscroll = 1 << 6, 256 | LogLevelLog = 1 << 7, 257 | LogLevelWarning = 1 << 8, 258 | LogLevelError = 1 << 9, 259 | ShowTimestamp = 1 << 10, 260 | ClearOnBuild = 1 << 11, 261 | }; 262 | 263 | static ConsoleWindow ms_ConsoleWindow = null; 264 | 265 | static internal void LoadIcons() 266 | { 267 | if (ms_LoadedIcons) 268 | return; 269 | 270 | ms_LoadedIcons = true; 271 | iconInfo = EditorGUIUtility.LoadIcon("console.infoicon"); 272 | iconWarn = EditorGUIUtility.LoadIcon("console.warnicon"); 273 | iconError = EditorGUIUtility.LoadIcon("console.erroricon"); 274 | iconInfoSmall = EditorGUIUtility.LoadIcon("console.infoicon.sml"); 275 | iconWarnSmall = EditorGUIUtility.LoadIcon("console.warnicon.sml"); 276 | iconErrorSmall = EditorGUIUtility.LoadIcon("console.erroricon.sml"); 277 | iconFirstErrorSmall = EditorGUIUtility.LoadIcon("sv_icon_dot14_sml"); 278 | 279 | // TODO: Once we get the proper monochrome images put them here. 280 | /*iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.mono"); 281 | iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.mono"); 282 | iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.mono");*/ 283 | iconInfoMono = EditorGUIUtility.LoadIcon("console.infoicon.sml"); 284 | iconWarnMono = EditorGUIUtility.LoadIcon("console.warnicon.inactive.sml"); 285 | iconErrorMono = EditorGUIUtility.LoadIcon("console.erroricon.inactive.sml"); 286 | iconFirstErrorMono = EditorGUIUtility.LoadIcon("sv_icon_dot8_sml"); 287 | iconCustomFiltersMono = EditorGUIUtility.LoadIcon("sv_icon_dot0_sml"); 288 | 289 | iconCustomFiltersSmalls = new Texture2D[7]; 290 | for (int i = 0; i < 7; i++) 291 | { 292 | iconCustomFiltersSmalls[i] = EditorGUIUtility.LoadIcon("sv_icon_dot" + (i + 1) + "_sml"); 293 | } 294 | Constants.Init(); 295 | } 296 | 297 | public void DoLogChanged(string logString, string stackTrace, LogType type) 298 | { 299 | if (ms_ConsoleWindow == null) 300 | return; 301 | 302 | ms_ConsoleWindow.m_NextRepaint = EditorApplication.timeSinceStartup + 0.25f; 303 | } 304 | 305 | public ConsoleWindow() 306 | { 307 | position = new Rect(200, 200, 800, 400); 308 | m_ListView = new ListViewState(0, 0); 309 | m_ListViewMessage = new ListViewState(0, 14); 310 | m_StacktraceLineContextClickRow = -1; 311 | } 312 | 313 | void OnEnable() 314 | { 315 | #if UNITY_2018_3_OR_NEWER 316 | if (m_ConsoleAttachToPlayerState == null) 317 | m_ConsoleAttachToPlayerState = new ConsoleAttachToPlayerState(this); 318 | #endif 319 | 320 | MakeSureConsoleAlwaysOnlyOne(); 321 | 322 | titleContent = EditorGUIUtility.TextContentWithIcon("Console", "UnityEditor.ConsoleWindow"); 323 | titleContent = new GUIContent(titleContent) { text = "ConsoleT" }; 324 | ms_ConsoleWindow = this; 325 | #if UNITY_2018_1_OR_NEWER 326 | m_DevBuild = Unsupported.IsDeveloperMode(); 327 | #else 328 | m_DevBuild = Unsupported.IsDeveloperBuild(); 329 | #endif 330 | LogEntries.wrapped.searchHistory = m_SearchHistory; 331 | 332 | Constants.LogStyleLineCount = EditorPrefs.GetInt("ConsoleWindowLogLineCount", 2); 333 | Application.logMessageReceived += DoLogChanged; 334 | } 335 | 336 | void MakeSureConsoleAlwaysOnlyOne() 337 | { 338 | // make sure that console window is always open as only one. 339 | if (ms_ConsoleWindow != null) 340 | { 341 | // get the container window of this console window. 342 | ContainerWindow cw = ms_ConsoleWindow.m_Parent.window; 343 | 344 | // the container window must not be main view(prevent from quitting editor). 345 | if (cw.rootView.GetType() != typeof(MainView)) 346 | cw.Close(); 347 | } 348 | } 349 | 350 | void OnDisable() 351 | { 352 | Application.logMessageReceived -= DoLogChanged; 353 | 354 | #if UNITY_2018_3_OR_NEWER 355 | m_ConsoleAttachToPlayerState?.Dispose(); 356 | m_ConsoleAttachToPlayerState = null; 357 | #endif 358 | m_SearchHistory = LogEntries.wrapped.searchHistory; 359 | if (ms_ConsoleWindow == this) 360 | ms_ConsoleWindow = null; 361 | } 362 | 363 | void OnInspectorUpdate() 364 | { 365 | if (EditorApplication.timeSinceStartup > m_NextRepaint) 366 | { 367 | m_NextRepaint = double.MaxValue; 368 | Repaint(); 369 | } 370 | } 371 | 372 | private int RowHeight 373 | { 374 | get 375 | { 376 | return (Constants.LogStyleLineCount * m_LineHeight) + m_BorderHeight; 377 | } 378 | } 379 | 380 | private static bool HasFlag(ConsoleFlags flags) { return (CoreLog.LogEntries.consoleFlags & (int)flags) != 0; } 381 | private static void SetFlag(ConsoleFlags flags, bool val) { CoreLog.LogEntries.SetConsoleFlag((int)flags, val); } 382 | 383 | private static Texture2D GetIconForErrorMode(ConsoleFlags flags, bool large) 384 | { 385 | // Errors 386 | if (flags == ConsoleFlags.LogLevelError) 387 | return large ? iconError : iconErrorSmall; 388 | // Warnings 389 | if (flags == ConsoleFlags.LogLevelWarning) 390 | return large ? iconWarn : iconWarnSmall; 391 | // Logs 392 | return large ? iconInfo : iconInfoSmall; 393 | } 394 | 395 | private static GUIStyle GetStyleForErrorMode(ConsoleFlags flags, bool isIcon, bool isSmall) 396 | { 397 | // Errors 398 | if (flags == ConsoleFlags.LogLevelError) 399 | { 400 | if (isIcon) 401 | { 402 | if (isSmall) 403 | { 404 | return Constants.IconErrorSmallStyle; 405 | } 406 | return Constants.IconErrorStyle; 407 | } 408 | 409 | if (isSmall) 410 | { 411 | return Constants.ErrorSmallStyle; 412 | } 413 | return Constants.ErrorStyle; 414 | } 415 | // Warnings 416 | if (flags == ConsoleFlags.LogLevelWarning) 417 | { 418 | if (isIcon) 419 | { 420 | if (isSmall) 421 | { 422 | return Constants.IconWarningSmallStyle; 423 | } 424 | return Constants.IconWarningStyle; 425 | } 426 | 427 | if (isSmall) 428 | { 429 | return Constants.WarningSmallStyle; 430 | } 431 | return Constants.WarningStyle; 432 | } 433 | // Logs 434 | if (isIcon) 435 | { 436 | if (isSmall) 437 | { 438 | return Constants.IconLogSmallStyle; 439 | } 440 | return Constants.IconLogStyle; 441 | } 442 | 443 | if (isSmall) 444 | { 445 | return Constants.LogSmallStyle; 446 | } 447 | return Constants.LogStyle; 448 | } 449 | 450 | void SetActiveEntry(int selectedIndex) 451 | { 452 | m_ListViewMessage.row = -1; 453 | m_ListViewMessage.scrollPos.y = 0; 454 | if (selectedIndex != -1) 455 | { 456 | var instanceID = LogEntries.wrapped.SetSelectedEntry(selectedIndex); 457 | // ping object referred by the log entry 458 | if (m_ActiveInstanceID != instanceID) 459 | { 460 | m_ActiveInstanceID = instanceID; 461 | if (instanceID != 0) 462 | EditorGUIUtility.PingObject(instanceID); 463 | } 464 | } 465 | } 466 | 467 | void UpdateListView() 468 | { 469 | m_HasUpdatedGuiStyles = true; 470 | int newRowHeight = RowHeight; 471 | 472 | // We reset the scroll list to auto scrolling whenever the log entry count is modified 473 | m_ListView.rowHeight = newRowHeight; 474 | m_ListView.row = -1; 475 | m_ListView.scrollPos.y = LogEntries.wrapped.GetCount() * newRowHeight; 476 | } 477 | 478 | void OnGUI() 479 | { 480 | Event e = Event.current; 481 | LoadIcons(); 482 | LogEntries.wrapped.UpdateEntries(); 483 | 484 | if (!m_HasUpdatedGuiStyles) 485 | { 486 | m_LineHeight = Mathf.RoundToInt(Constants.ErrorStyle.lineHeight); 487 | m_BorderHeight = Constants.ErrorStyle.border.top + Constants.ErrorStyle.border.bottom; 488 | UpdateListView(); 489 | } 490 | 491 | GUILayout.BeginHorizontal(Constants.Toolbar); 492 | 493 | if (LogEntries.wrapped.importWatching) 494 | { 495 | LogEntries.wrapped.importWatching = GUILayout.Toggle(LogEntries.wrapped.importWatching, Constants.ImportWatchingLabel, Constants.MiniButton); 496 | } 497 | 498 | if (GUILayout.Button(Constants.ClearLabel, Constants.MiniButton)) 499 | { 500 | LogEntries.Clear(); 501 | GUIUtility.keyboardControl = 0; 502 | } 503 | 504 | int currCount = LogEntries.wrapped.GetCount(); 505 | 506 | if (m_ListView.totalRows != currCount && m_ListView.totalRows > 0) 507 | { 508 | // scroll bar was at the bottom? 509 | if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight) 510 | { 511 | m_ListView.scrollPos.y = currCount * RowHeight - ms_LVHeight; 512 | } 513 | } 514 | 515 | if (LogEntries.wrapped.searchFrame) 516 | { 517 | LogEntries.wrapped.searchFrame = false; 518 | int selectedIndex = LogEntries.wrapped.GetSelectedEntryIndex(); 519 | if (selectedIndex != -1) 520 | { 521 | int showIndex = selectedIndex + 1; 522 | if (currCount > showIndex) 523 | { 524 | int showCount = ms_LVHeight / RowHeight; 525 | showIndex = showIndex + showCount / 2; 526 | } 527 | m_ListView.scrollPos.y = showIndex * RowHeight - ms_LVHeight; 528 | } 529 | } 530 | 531 | EditorGUILayout.Space(); 532 | 533 | bool wasCollapsed = LogEntries.wrapped.collapse; 534 | LogEntries.wrapped.collapse = GUILayout.Toggle(wasCollapsed, Constants.CollapseLabel, Constants.MiniButton); 535 | 536 | bool collapsedChanged = (wasCollapsed != LogEntries.wrapped.collapse); 537 | if (collapsedChanged) 538 | { 539 | // unselect if collapsed flag changed 540 | m_ListView.row = -1; 541 | 542 | // scroll to bottom 543 | m_ListView.scrollPos.y = LogEntries.wrapped.GetCount() * RowHeight; 544 | } 545 | 546 | SetFlag(ConsoleFlags.ClearOnPlay, GUILayout.Toggle(HasFlag(ConsoleFlags.ClearOnPlay), Constants.ClearOnPlayLabel, Constants.MiniButton)); 547 | #if UNITY_2019_1_OR_NEWER 548 | SetFlag(ConsoleFlags.ClearOnBuild, GUILayout.Toggle(HasFlag(ConsoleFlags.ClearOnBuild), Constants.ClearOnBuildLabel, Constants.MiniButton)); 549 | #endif 550 | SetFlag(ConsoleFlags.ErrorPause, GUILayout.Toggle(HasFlag(ConsoleFlags.ErrorPause), Constants.ErrorPauseLabel, Constants.MiniButton)); 551 | 552 | #if UNITY_2020_1_OR_NEWER 553 | PlayerConnectionGUILayout.ConnectionTargetSelectionDropdown(m_ConsoleAttachToPlayerState, EditorStyles.toolbarDropDown); 554 | #elif UNITY_2018_3_OR_NEWER 555 | ConnectionGUILayout.AttachToPlayerDropdown(m_ConsoleAttachToPlayerState, EditorStyles.toolbarDropDown); 556 | #endif 557 | 558 | EditorGUILayout.Space(); 559 | 560 | if (m_DevBuild) 561 | { 562 | GUILayout.FlexibleSpace(); 563 | SetFlag(ConsoleFlags.StopForAssert, GUILayout.Toggle(HasFlag(ConsoleFlags.StopForAssert), Constants.StopForAssertLabel, Constants.MiniButton)); 564 | SetFlag(ConsoleFlags.StopForError, GUILayout.Toggle(HasFlag(ConsoleFlags.StopForError), Constants.StopForErrorLabel, Constants.MiniButton)); 565 | } 566 | 567 | GUILayout.FlexibleSpace(); 568 | 569 | // Search bar 570 | GUILayout.Space(4f); 571 | SearchField(e); 572 | 573 | int errorCount = 0, warningCount = 0, logCount = 0; 574 | LogEntries.wrapped.GetCountsByType(ref errorCount, ref warningCount, ref logCount); 575 | EditorGUI.BeginChangeCheck(); 576 | bool setLogFlag = GUILayout.Toggle(LogEntries.wrapped.HasFlag((int)ConsoleFlags.LogLevelLog), new GUIContent((logCount <= 999 ? logCount.ToString() : "999+"), logCount > 0 ? iconInfoSmall : iconInfoMono), Constants.MiniButton); 577 | bool setWarningFlag = GUILayout.Toggle(LogEntries.wrapped.HasFlag((int)ConsoleFlags.LogLevelWarning), new GUIContent((warningCount <= 999 ? warningCount.ToString() : "999+"), warningCount > 0 ? iconWarnSmall : iconWarnMono), Constants.MiniButton); 578 | bool setErrorFlag = GUILayout.Toggle(LogEntries.wrapped.HasFlag((int)ConsoleFlags.LogLevelError), new GUIContent((errorCount <= 999 ? errorCount.ToString() : "999+"), errorCount > 0 ? iconErrorSmall : iconErrorMono), Constants.MiniButton); 579 | // Active entry index may no longer be valid 580 | if (EditorGUI.EndChangeCheck()) 581 | { } 582 | 583 | LogEntries.wrapped.SetFlag((int)ConsoleFlags.LogLevelLog, setLogFlag); 584 | LogEntries.wrapped.SetFlag((int)ConsoleFlags.LogLevelWarning, setWarningFlag); 585 | LogEntries.wrapped.SetFlag((int)ConsoleFlags.LogLevelError, setErrorFlag); 586 | 587 | if (GUILayout.Button(new GUIContent(errorCount > 0 ? iconFirstErrorSmall : iconFirstErrorMono, Constants.FirstErrorLabel), Constants.MiniButton)) 588 | { 589 | int firstErrorIndex = LogEntries.wrapped.GetFirstErrorEntryIndex(); 590 | if (firstErrorIndex != -1) 591 | { 592 | SetActiveEntry(firstErrorIndex); 593 | LogEntries.wrapped.searchFrame = true; 594 | } 595 | } 596 | 597 | GUILayout.EndHorizontal(); 598 | 599 | SplitterGUILayout.BeginVerticalSplit(spl); 600 | int rowHeight = RowHeight; 601 | EditorGUIUtility.SetIconSize(new Vector2(rowHeight, rowHeight)); 602 | GUIContent tempContent = new GUIContent(); 603 | int id = GUIUtility.GetControlID(0); 604 | int rowDoubleClicked = -1; 605 | 606 | /////@TODO: Make Frame selected work with ListViewState 607 | using (new GettingLogEntriesScope(m_ListView)) 608 | { 609 | int selectedRow = -1; 610 | bool openSelectedItem = false; 611 | bool collapsed = LogEntries.wrapped.collapse; 612 | foreach (ListViewElement el in ListViewGUI.ListView(m_ListView, Constants.Box)) 613 | { 614 | if (e.type == EventType.MouseDown && e.button == 0 && el.position.Contains(e.mousePosition)) 615 | { 616 | m_ListView.row = el.row; 617 | selectedRow = el.row; 618 | if (e.clickCount == 2) 619 | openSelectedItem = true; 620 | } 621 | else if (e.type == EventType.Repaint) 622 | { 623 | int mode = 0; 624 | int entryCount = 0; 625 | int searchIndex = 0; 626 | int searchEndIndex = 0; 627 | string text = LogEntries.wrapped.GetEntryLinesAndFlagAndCount(el.row, ref mode, ref entryCount, 628 | ref searchIndex, ref searchEndIndex); 629 | ConsoleFlags flag = (ConsoleFlags)mode; 630 | bool isSelected = LogEntries.wrapped.IsEntrySelected(el.row); 631 | 632 | // Draw the background 633 | GUIStyle s = el.row % 2 == 0 ? Constants.OddBackground : Constants.EvenBackground; 634 | s.Draw(el.position, false, false, isSelected, false); 635 | 636 | // Draw the icon 637 | #if !UNITY_2017_3_OR_NEWER 638 | if (Constants.LogStyleLineCount == 1) 639 | { 640 | Rect rt = el.position; 641 | rt.x += 6f; 642 | rt.y += 2f; 643 | rt.width = 16f; 644 | rt.height = 16f; 645 | GUI.DrawTexture(rt, GetIconForErrorMode(flag, false)); 646 | } 647 | else 648 | #endif 649 | { 650 | GUIStyle iconStyle = GetStyleForErrorMode(flag, true, Constants.LogStyleLineCount == 1); 651 | iconStyle.Draw(el.position, false, false, isSelected, false); 652 | } 653 | 654 | // Draw the text 655 | tempContent.text = text; 656 | GUIStyle errorModeStyle = GetStyleForErrorMode(flag, false, Constants.LogStyleLineCount == 1); 657 | 658 | if (string.IsNullOrEmpty(LogEntries.wrapped.searchString) || searchIndex == -1 || searchIndex >= text.Length) 659 | { 660 | errorModeStyle.Draw(el.position, tempContent, id, isSelected); 661 | } 662 | else 663 | { 664 | errorModeStyle.DrawWithTextSelection(el.position, tempContent, GUIUtility.keyboardControl, searchIndex, searchEndIndex); 665 | } 666 | 667 | if (collapsed) 668 | { 669 | Rect badgeRect = el.position; 670 | tempContent.text = entryCount.ToString(CultureInfo.InvariantCulture); 671 | Vector2 badgeSize = Constants.CountBadge.CalcSize(tempContent); 672 | badgeRect.xMin = badgeRect.xMax - badgeSize.x; 673 | badgeRect.yMin += ((badgeRect.yMax - badgeRect.yMin) - badgeSize.y) * 0.5f; 674 | badgeRect.x -= 5f; 675 | GUI.Label(badgeRect, tempContent, Constants.CountBadge); 676 | } 677 | } 678 | } 679 | 680 | if (selectedRow != -1) 681 | { 682 | if (m_ListView.scrollPos.y >= m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight) 683 | m_ListView.scrollPos.y = m_ListView.rowHeight * m_ListView.totalRows - ms_LVHeight - 1; 684 | } 685 | 686 | // Make sure the selected entry is up to date 687 | if (m_ListView.totalRows == 0 || m_ListView.row >= m_ListView.totalRows || m_ListView.row < 0) 688 | { 689 | } 690 | else 691 | { 692 | if (m_ListView.selectionChanged) 693 | { 694 | SetActiveEntry(m_ListView.row); 695 | } 696 | } 697 | 698 | // Open entry using return key 699 | if ((GUIUtility.keyboardControl == m_ListView.ID) && (e.type == EventType.KeyDown) && (e.keyCode == KeyCode.Return) && (m_ListView.row != 0)) 700 | { 701 | selectedRow = m_ListView.row; 702 | openSelectedItem = true; 703 | } 704 | 705 | if (e.type != EventType.Layout && ListViewGUI.ilvState.rectHeight != 1) 706 | ms_LVHeight = ListViewGUI.ilvState.rectHeight; 707 | 708 | if (openSelectedItem) 709 | { 710 | rowDoubleClicked = selectedRow; 711 | e.Use(); 712 | } 713 | 714 | if (selectedRow != -1) 715 | { 716 | SetActiveEntry(selectedRow); 717 | } 718 | } 719 | 720 | // Prevent dead locking in EditorMonoConsole by delaying callbacks (which can log to the console) until after LogEntries.EndGettingEntries() has been 721 | // called (this releases the mutex in EditorMonoConsole so logging again is allowed). Fix for case 1081060. 722 | if (rowDoubleClicked != -1) 723 | LogEntries.wrapped.StacktraceListView_RowGotDoubleClicked(); 724 | 725 | EditorGUIUtility.SetIconSize(Vector2.zero); 726 | 727 | StacktraceListView(e, tempContent); 728 | 729 | SplitterGUILayout.EndVerticalSplit(); 730 | 731 | // Copy & Paste selected item 732 | if ((e.type == EventType.ValidateCommand || e.type == EventType.ExecuteCommand) && e.commandName == "Copy") 733 | { 734 | if (e.type == EventType.ExecuteCommand) 735 | LogEntries.wrapped.StacktraceListView_CopyAll(); 736 | e.Use(); 737 | } 738 | } 739 | 740 | private void SearchField(Event e) 741 | { 742 | string searchBarName = "SearchFilter"; 743 | if (e.commandName == "Find") 744 | { 745 | if (e.type == EventType.ExecuteCommand) 746 | { 747 | EditorGUI.FocusTextInControl(searchBarName); 748 | } 749 | 750 | if (e.type != EventType.Layout) 751 | e.Use(); 752 | } 753 | 754 | string searchText = LogEntries.wrapped.searchString; 755 | if (e.type == EventType.KeyDown) 756 | { 757 | if (e.keyCode == KeyCode.Escape) 758 | { 759 | searchText = string.Empty; 760 | GUIUtility.keyboardControl = m_ListView.ID; 761 | Repaint(); 762 | } 763 | else if ((e.keyCode == KeyCode.UpArrow || e.keyCode == KeyCode.DownArrow) && 764 | GUI.GetNameOfFocusedControl() == searchBarName) 765 | { 766 | GUIUtility.keyboardControl = m_ListView.ID; 767 | } 768 | } 769 | 770 | GUI.SetNextControlName(searchBarName); 771 | Rect rect = GUILayoutUtility.GetRect(0, EditorGUILayout.kLabelFloatMaxW * 1.5f, EditorGUI.kSingleLineHeight, 772 | EditorGUI.kSingleLineHeight, EditorStyles.toolbarSearchField, GUILayout.MinWidth(100), 773 | GUILayout.MaxWidth(300)); 774 | 775 | bool showHistory = LogEntries.wrapped.searchHistory[0].Length != 0; 776 | Rect popupPosition = rect; 777 | popupPosition.width = 20; 778 | if (showHistory && Event.current.type == EventType.MouseDown && popupPosition.Contains(Event.current.mousePosition)) 779 | { 780 | GUIUtility.keyboardControl = 0; 781 | EditorUtility.DisplayCustomMenu(rect, EditorGUIUtility.TempContent(LogEntries.wrapped.searchHistory), -1, OnSetFilteringHistoryCallback, null); 782 | Event.current.Use(); 783 | } 784 | 785 | LogEntries.wrapped.searchString = EditorGUI.ToolbarSearchField( 786 | #if !UNITY_2018_1_OR_NEWER 787 | GUIUtility.GetControlID("EditorSearchField".GetHashCode(), FocusType.Keyboard, position), 788 | #endif 789 | rect, searchText, showHistory); 790 | 791 | if (GUILayout.Button(new GUIContent(iconCustomFiltersMono, Constants.CustomFiltersLabel), EditorStyles.toolbarDropDown)) 792 | { 793 | Rect buttonRect = rect; 794 | buttonRect.x += buttonRect.width; 795 | var menuData = new CustomFiltersItemProvider(LogEntries.wrapped.customFilters); 796 | var flexibleMenu = new FlexibleMenu(menuData, -1, new CustomFiltersModifyItemUI(), null); 797 | PopupWindow.Show(buttonRect, flexibleMenu); 798 | } 799 | 800 | int iconIndex = 0; 801 | foreach (var filter in LogEntries.wrapped.customFilters.filters) 802 | { 803 | if (iconIndex >= 7) 804 | { 805 | iconIndex = 0; 806 | } 807 | filter.toggle = GUILayout.Toggle(filter.toggle, new GUIContent(filter.filter, iconCustomFiltersSmalls[iconIndex++]), Constants.MiniButton); 808 | } 809 | } 810 | 811 | private void OnSetFilteringHistoryCallback(object userData, string[] options, int selected) 812 | { 813 | LogEntries.wrapped.searchString = options[selected]; 814 | } 815 | 816 | #region Stacktrace 817 | 818 | private void StacktraceListView(Event e, GUIContent tempContent) 819 | { 820 | float maxWidth = LogEntries.wrapped.StacktraceListView_GetMaxWidth(tempContent, Constants.MessageStyle); 821 | 822 | if (m_StacktraceLineContextClickRow != -1) 823 | { 824 | var stacktraceLineInfoIndex = m_StacktraceLineContextClickRow; 825 | m_StacktraceLineContextClickRow = -1; 826 | GenericMenu menu = new GenericMenu(); 827 | if (LogEntries.wrapped.StacktraceListView_CanOpen(stacktraceLineInfoIndex)) 828 | { 829 | menu.AddItem(new GUIContent("Open"), false, LogEntries.wrapped.StacktraceListView_Open, stacktraceLineInfoIndex); 830 | menu.AddSeparator(""); 831 | if (LogEntries.wrapped.StacktraceListView_CanWrapper(stacktraceLineInfoIndex)) 832 | { 833 | menu.AddItem(new GUIContent("Wrapper"), LogEntries.wrapped.StacktraceListView_IsWrapper(stacktraceLineInfoIndex), LogEntries.wrapped.StacktraceListView_Wrapper, stacktraceLineInfoIndex); 834 | } 835 | } 836 | menu.AddItem(new GUIContent("Copy"), false, LogEntries.wrapped.StacktraceListView_Copy, stacktraceLineInfoIndex); 837 | menu.AddItem(new GUIContent("Copy All"), false, LogEntries.wrapped.StacktraceListView_CopyAll); 838 | menu.ShowAsContext(); 839 | } 840 | 841 | int id = GUIUtility.GetControlID(0); 842 | int rowDoubleClicked = -1; 843 | int selectedRow = -1; 844 | bool openSelectedItem = false; 845 | m_ListViewMessage.totalRows = LogEntries.wrapped.StacktraceListView_GetCount(); 846 | GUILayout.BeginHorizontal(Constants.Box); 847 | m_ListViewMessage.scrollPos = EditorGUILayout.BeginScrollView(m_ListViewMessage.scrollPos); 848 | ListViewGUI.ilvState.beganHorizontal = true; 849 | m_ListViewMessage.draggedFrom = -1; 850 | m_ListViewMessage.draggedTo = -1; 851 | m_ListViewMessage.fileNames = (string[])null; 852 | Rect rect = GUILayoutUtility.GetRect(maxWidth, 853 | (float)(m_ListViewMessage.totalRows * m_ListViewMessage.rowHeight + 3)); 854 | foreach (ListViewElement el in ListViewGUI.DoListView(rect, m_ListViewMessage, null, string.Empty)) 855 | { 856 | if (e.type == EventType.MouseDown && (e.button == 0 || e.button == 1) && el.position.Contains(e.mousePosition)) 857 | { 858 | if (e.button == 1) 859 | { 860 | m_ListViewMessage.row = el.row; 861 | selectedRow = m_ListViewMessage.row; 862 | m_StacktraceLineContextClickRow = selectedRow; 863 | continue; 864 | } 865 | 866 | selectedRow = m_ListViewMessage.row; 867 | if (e.clickCount == 2) 868 | openSelectedItem = true; 869 | } 870 | else if (e.type == EventType.Repaint) 871 | { 872 | tempContent.text = LogEntries.wrapped.StacktraceListView_GetLine(el.row); 873 | rect = el.position; 874 | if (rect.width < maxWidth) 875 | { 876 | rect.width = maxWidth; 877 | } 878 | Constants.MessageStyle.Draw(rect, tempContent, id, m_ListViewMessage.row == el.row); 879 | } 880 | } 881 | 882 | // Open entry using return key 883 | if ((GUIUtility.keyboardControl == m_ListViewMessage.ID) && (e.type == EventType.KeyDown) && (e.keyCode == KeyCode.Return) && (m_ListViewMessage.row != 0)) 884 | { 885 | selectedRow = m_ListViewMessage.row; 886 | openSelectedItem = true; 887 | } 888 | 889 | if (openSelectedItem) 890 | { 891 | rowDoubleClicked = selectedRow; 892 | e.Use(); 893 | } 894 | 895 | if (m_StacktraceLineContextClickRow != -1) 896 | { 897 | Repaint(); 898 | } 899 | 900 | if (rowDoubleClicked != -1) 901 | { 902 | LogEntries.wrapped.StacktraceListView_Open(rowDoubleClicked); 903 | } 904 | } 905 | 906 | #endregion 907 | 908 | public struct StackTraceLogTypeData 909 | { 910 | public LogType logType; 911 | public StackTraceLogType stackTraceLogType; 912 | } 913 | 914 | public void ToggleLogStackTraces(object userData) 915 | { 916 | StackTraceLogTypeData data = (StackTraceLogTypeData)userData; 917 | PlayerSettings.SetStackTraceLogType(data.logType, data.stackTraceLogType); 918 | } 919 | 920 | public void ToggleLogStackTracesForAll(object userData) 921 | { 922 | foreach (LogType logType in Enum.GetValues(typeof(LogType))) 923 | PlayerSettings.SetStackTraceLogType(logType, (StackTraceLogType)userData); 924 | } 925 | 926 | public void AddItemsToMenu(GenericMenu menu) 927 | { 928 | if (Application.platform == RuntimePlatform.OSXEditor) 929 | menu.AddItem(EditorGUIUtility.TextContent("Open Player Log"), false, UnityEditorInternal.InternalEditorUtility.OpenPlayerConsole); 930 | menu.AddItem(EditorGUIUtility.TextContent("Open Editor Log"), false, UnityEditorInternal.InternalEditorUtility.OpenEditorConsole); 931 | menu.AddItem(EditorGUIUtility.TextContent("Export Console Log"), false, LogEntries.wrapped.ExportLog); 932 | menu.AddItem(EditorGUIUtility.TextContent("Import Console Log"), false, LogEntries.wrapped.ImportLog); 933 | 934 | #if UNITY_2018_1_OR_NEWER 935 | menu.AddItem(EditorGUIUtility.TrTextContent("Show Timestamp"), LogEntries.wrapped.showTimestamp, SetTimestamp); 936 | #endif 937 | 938 | #if UNITY_2017_3_OR_NEWER 939 | for (int i = 1; i <= 10; ++i) 940 | #else 941 | for (int i = 1; i <= 2; ++i) 942 | #endif 943 | { 944 | var lineString = i == 1 ? "Line" : "Lines"; 945 | menu.AddItem(new GUIContent(string.Format("Log Entry/{0} {1}", i, lineString)), i == Constants.LogStyleLineCount, SetLogLineCount, i); 946 | } 947 | 948 | AddStackTraceLoggingMenu(menu); 949 | 950 | menu.AddItem(EditorGUIUtility.TextContent("Lua Script Editor"), false, ScriptAssetOpener.SetLuaScriptEditor); 951 | } 952 | 953 | private void SetTimestamp() 954 | { 955 | LogEntries.wrapped.showTimestamp = !LogEntries.wrapped.showTimestamp; 956 | } 957 | 958 | private void SetLogLineCount(object obj) 959 | { 960 | int count = (int)obj; 961 | EditorPrefs.SetInt("ConsoleWindowLogLineCount", count); 962 | Constants.LogStyleLineCount = count; 963 | 964 | UpdateListView(); 965 | } 966 | 967 | private void AddStackTraceLoggingMenu(GenericMenu menu) 968 | { 969 | // TODO: Maybe remove this, because it basically duplicates UI in PlayerSettings 970 | foreach (LogType logType in Enum.GetValues(typeof(LogType))) 971 | { 972 | foreach (StackTraceLogType stackTraceLogType in Enum.GetValues(typeof(StackTraceLogType))) 973 | { 974 | StackTraceLogTypeData data; 975 | data.logType = logType; 976 | data.stackTraceLogType = stackTraceLogType; 977 | 978 | menu.AddItem(EditorGUIUtility.TextContent("Stack Trace Logging/" + logType + "/" + stackTraceLogType), PlayerSettings.GetStackTraceLogType(logType) == stackTraceLogType, 979 | ToggleLogStackTraces, data); 980 | } 981 | } 982 | 983 | int stackTraceLogTypeForAll = (int)PlayerSettings.GetStackTraceLogType(LogType.Log); 984 | foreach (LogType logType in Enum.GetValues(typeof(LogType))) 985 | { 986 | if (PlayerSettings.GetStackTraceLogType(logType) != (StackTraceLogType)stackTraceLogTypeForAll) 987 | { 988 | stackTraceLogTypeForAll = -1; 989 | break; 990 | } 991 | } 992 | 993 | foreach (StackTraceLogType stackTraceLogType in Enum.GetValues(typeof(StackTraceLogType))) 994 | { 995 | menu.AddItem(EditorGUIUtility.TextContent("Stack Trace Logging/All/" + stackTraceLogType), (StackTraceLogType)stackTraceLogTypeForAll == stackTraceLogType, 996 | ToggleLogStackTracesForAll, stackTraceLogType); 997 | } 998 | } 999 | } 1000 | 1001 | internal class GettingLogEntriesScope : IDisposable 1002 | { 1003 | private bool m_Disposed; 1004 | 1005 | public GettingLogEntriesScope(ListViewState listView) 1006 | { 1007 | listView.totalRows = LogEntries.wrapped.GetCount(); 1008 | } 1009 | 1010 | public void Dispose() 1011 | { 1012 | if (m_Disposed) 1013 | return; 1014 | m_Disposed = true; 1015 | } 1016 | 1017 | ~GettingLogEntriesScope() 1018 | { 1019 | if (!m_Disposed) 1020 | Debug.LogError("Scope was not disposed! You should use the 'using' keyword or manually call Dispose."); 1021 | } 1022 | } 1023 | 1024 | #region CustomFilters 1025 | 1026 | internal class CustomFiltersItemProvider : IFlexibleMenuItemProvider 1027 | { 1028 | private readonly LogEntries.EntryWrapped.CustomFiltersGroup m_Groups; 1029 | 1030 | public CustomFiltersItemProvider(LogEntries.EntryWrapped.CustomFiltersGroup groups) 1031 | { 1032 | m_Groups = groups; 1033 | } 1034 | 1035 | public int Count() 1036 | { 1037 | return m_Groups.filters.Count; 1038 | } 1039 | 1040 | public object GetItem(int index) 1041 | { 1042 | return m_Groups.filters[index].filter; 1043 | } 1044 | 1045 | public int Add(object obj) 1046 | { 1047 | m_Groups.filters.Add(new LogEntries.EntryWrapped.CustomFiltersItem() { filter = (string)obj, changed = false }); 1048 | m_Groups.Save(); 1049 | return Count() - 1; 1050 | } 1051 | 1052 | public void Replace(int index, object newPresetObject) 1053 | { 1054 | m_Groups.filters[index].filter = (string)newPresetObject; 1055 | m_Groups.Save(); 1056 | } 1057 | 1058 | public void Remove(int index) 1059 | { 1060 | if (m_Groups.filters[index].toggle) 1061 | { 1062 | m_Groups.changed = true; 1063 | } 1064 | m_Groups.filters.RemoveAt(index); 1065 | m_Groups.Save(); 1066 | } 1067 | 1068 | public object Create() 1069 | { 1070 | return "log"; 1071 | } 1072 | 1073 | public void Move(int index, int destIndex, bool insertAfterDestIndex) 1074 | { 1075 | Debug.LogError("Missing impl"); 1076 | } 1077 | 1078 | public string GetName(int index) 1079 | { 1080 | return m_Groups.filters[index].filter; 1081 | } 1082 | 1083 | public bool IsModificationAllowed(int index) 1084 | { 1085 | return true; 1086 | } 1087 | 1088 | public int[] GetSeperatorIndices() 1089 | { 1090 | return new int[0]; 1091 | } 1092 | } 1093 | 1094 | internal class CustomFiltersModifyItemUI : FlexibleMenuModifyItemUI 1095 | { 1096 | private static class Styles 1097 | { 1098 | public static GUIContent headerAdd = EditorGUIUtility.TextContent("Add"); 1099 | public static GUIContent headerEdit = EditorGUIUtility.TextContent("Edit"); 1100 | public static GUIContent optionalText = EditorGUIUtility.TextContent("Search"); 1101 | public static GUIContent ok = EditorGUIUtility.TextContent("OK"); 1102 | public static GUIContent cancel = EditorGUIUtility.TextContent("Cancel"); 1103 | } 1104 | 1105 | private string m_TextSearch; 1106 | 1107 | public override void OnClose() 1108 | { 1109 | m_TextSearch = null; 1110 | base.OnClose(); 1111 | } 1112 | 1113 | public override Vector2 GetWindowSize() 1114 | { 1115 | return new Vector2(330f, 80f); 1116 | } 1117 | 1118 | public override void OnGUI(Rect rect) 1119 | { 1120 | string itemValue = m_Object as string; 1121 | if (itemValue == null) 1122 | { 1123 | Debug.LogError("Invalid object"); 1124 | return; 1125 | } 1126 | 1127 | if (m_TextSearch == null) 1128 | { 1129 | m_TextSearch = itemValue; 1130 | } 1131 | 1132 | const float kColumnWidth = 70f; 1133 | const float kSpacing = 10f; 1134 | 1135 | GUILayout.Space(3); 1136 | GUILayout.Label(m_MenuType == MenuType.Add ? Styles.headerAdd : Styles.headerEdit, EditorStyles.boldLabel); 1137 | 1138 | Rect seperatorRect = GUILayoutUtility.GetRect(1, 1); 1139 | FlexibleMenu.DrawRect(seperatorRect, 1140 | (EditorGUIUtility.isProSkin) 1141 | ? new Color(0.32f, 0.32f, 0.32f, 1.333f) 1142 | : new Color(0.6f, 0.6f, 0.6f, 1.333f)); // dark : light 1143 | GUILayout.Space(4); 1144 | 1145 | // Optional text 1146 | GUILayout.BeginHorizontal(); 1147 | GUILayout.Label(Styles.optionalText, GUILayout.Width(kColumnWidth)); 1148 | GUILayout.Space(kSpacing); 1149 | m_TextSearch = EditorGUILayout.TextField(m_TextSearch); 1150 | GUILayout.EndHorizontal(); 1151 | 1152 | GUILayout.Space(5f); 1153 | 1154 | // Cancel, Ok 1155 | GUILayout.BeginHorizontal(); 1156 | GUILayout.Space(10); 1157 | if (GUILayout.Button(Styles.cancel)) 1158 | { 1159 | editorWindow.Close(); 1160 | } 1161 | 1162 | if (GUILayout.Button(Styles.ok)) 1163 | { 1164 | var textSearch = m_TextSearch.Trim(); 1165 | if (!string.IsNullOrEmpty(textSearch)) 1166 | { 1167 | m_Object = m_TextSearch; 1168 | Accepted(); 1169 | editorWindow.Close(); 1170 | } 1171 | } 1172 | GUILayout.Space(10); 1173 | GUILayout.EndHorizontal(); 1174 | } 1175 | } 1176 | 1177 | #endregion 1178 | } 1179 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/ConsoleWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 253fb941566affc47aac9f4d9c1db81b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/LogEntries.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Text; 5 | using UnityEditor; 6 | using UnityEngine; 7 | #if UNITY_2017_1_OR_NEWER 8 | using CoreLog = UnityEditor; 9 | #else 10 | using CoreLog = UnityEditorInternal; 11 | #endif 12 | 13 | namespace ConsoleTiny 14 | { 15 | public class LogEntries 16 | { 17 | public static void Clear() 18 | { 19 | CoreLog.LogEntries.Clear(); 20 | } 21 | 22 | internal static EntryWrapped wrapped = new EntryWrapped(); 23 | 24 | internal class EntryWrapped 25 | { 26 | private class EntryInfo 27 | { 28 | public int row; 29 | public string lines; 30 | public string text; 31 | public string pure; // remove tag 32 | public string lower; 33 | public int entryCount; 34 | public int searchIndex; 35 | public int searchEndIndex; 36 | public ConsoleFlags flags; 37 | public CoreLog.LogEntry entry; 38 | public List stacktraceLineInfos; 39 | public List tagPosInfos; 40 | } 41 | 42 | [Flags] 43 | enum Mode 44 | { 45 | Error = 1 << 0, 46 | Assert = 1 << 1, 47 | Log = 1 << 2, 48 | Fatal = 1 << 4, 49 | DontPreprocessCondition = 1 << 5, 50 | AssetImportError = 1 << 6, 51 | AssetImportWarning = 1 << 7, 52 | ScriptingError = 1 << 8, 53 | ScriptingWarning = 1 << 9, 54 | ScriptingLog = 1 << 10, 55 | ScriptCompileError = 1 << 11, 56 | ScriptCompileWarning = 1 << 12, 57 | StickyError = 1 << 13, 58 | MayIgnoreLineNumber = 1 << 14, 59 | ReportBug = 1 << 15, 60 | DisplayPreviousErrorInStatusBar = 1 << 16, 61 | ScriptingException = 1 << 17, 62 | DontExtractStacktrace = 1 << 18, 63 | ShouldClearOnPlay = 1 << 19, 64 | GraphCompileError = 1 << 20, 65 | ScriptingAssertion = 1 << 21, 66 | VisualScriptingError = 1 << 22 67 | }; 68 | 69 | enum ConsoleFlags 70 | { 71 | Collapse = 1 << 0, 72 | LogLevelLog = 1 << 7, 73 | LogLevelWarning = 1 << 8, 74 | LogLevelError = 1 << 9, 75 | ShowTimestamp = 1 << 10, 76 | }; 77 | 78 | public int numberOfLines 79 | { 80 | private get { return m_NumberOfLines; } 81 | set { m_NumberOfLines = value; ResetEntriesForNumberLines(); } 82 | } 83 | 84 | public bool showTimestamp 85 | { 86 | get { return m_ShowTimestamp; } 87 | set 88 | { 89 | m_ShowTimestamp = value; 90 | EditorPrefs.SetBool(kPrefShowTimestamp, value); 91 | ResetEntriesForNumberLines(); 92 | } 93 | } 94 | 95 | public bool collapse 96 | { 97 | get { return m_Collapse; } 98 | set 99 | { 100 | if (m_Collapse != value) 101 | { 102 | m_Collapse = value; 103 | EditorPrefs.SetBool(kPrefCollapse, value); 104 | ClearEntries(); 105 | UpdateEntries(); 106 | } 107 | } 108 | } 109 | 110 | public string searchString 111 | { 112 | get { return m_SearchString; } 113 | set { m_SearchStringComing = value; } 114 | } 115 | 116 | public string[] searchHistory = new[] { "" }; 117 | 118 | public bool searchFrame { get; set; } 119 | 120 | public bool importWatching 121 | { 122 | get { return m_ImportWatching; } 123 | set 124 | { 125 | m_ImportWatching = value; 126 | if (!value) 127 | { 128 | ClearEntries(); 129 | UpdateEntries(); 130 | } 131 | } 132 | } 133 | 134 | private int m_ConsoleFlags; 135 | private int m_ConsoleFlagsComing; 136 | private string m_SearchString; 137 | private string m_SearchStringComing; 138 | private double m_LastSearchStringTime; 139 | 140 | private bool m_Init; 141 | private bool m_ImportWatching; 142 | private int m_NumberOfLines; 143 | private bool m_ShowTimestamp; 144 | private bool m_Collapse; 145 | private int[] m_TypeCounts = new[] { 0, 0, 0 }; 146 | private int m_LastEntryCount = -1; 147 | private EntryInfo m_SelectedInfo; 148 | private readonly List m_EntryInfos = new List(); 149 | private readonly List m_FilteredInfos = new List(); 150 | private readonly CustomFiltersGroup m_CustomFilters = new CustomFiltersGroup(); 151 | private readonly List m_WrapperInfos = new List(); 152 | 153 | private const string kPrefConsoleFlags = "ConsoleTiny_ConsoleFlags"; 154 | private const string kPrefShowTimestamp = "ConsoleTiny_ShowTimestamp"; 155 | private const string kPrefCollapse = "ConsoleTiny_Collapse"; 156 | private const string kPrefCustomFilters = "ConsoleTiny_CustomFilters"; 157 | private const string kPrefWrappers = "ConsoleTiny_Wrappers"; 158 | 159 | public bool HasFlag(int flags) { return (m_ConsoleFlags & flags) != 0; } 160 | 161 | public void SetFlag(int flags, bool val) { SetConsoleFlag(flags, val); } 162 | 163 | private void SetConsoleFlag(int bit, bool value) 164 | { 165 | if (value) 166 | { 167 | m_ConsoleFlagsComing |= bit; 168 | } 169 | else 170 | { 171 | m_ConsoleFlagsComing &= ~bit; 172 | } 173 | } 174 | 175 | public int GetCount() 176 | { 177 | return m_FilteredInfos.Count; 178 | } 179 | 180 | public string GetEntryLinesAndFlagAndCount(int row, ref int consoleFlag, ref int entryCount, ref int searchIndex, ref int searchEndIndex) 181 | { 182 | if (row < 0 || row >= m_FilteredInfos.Count) 183 | { 184 | return String.Empty; 185 | } 186 | 187 | EntryInfo entryInfo = m_FilteredInfos[row]; 188 | consoleFlag = (int)entryInfo.flags; 189 | entryCount = entryInfo.entryCount; 190 | searchIndex = entryInfo.searchIndex; 191 | searchEndIndex = entryInfo.searchEndIndex; 192 | return entryInfo.text; 193 | } 194 | 195 | public void GetCountsByType(ref int errorCount, ref int warningCount, ref int logCount) 196 | { 197 | errorCount = m_TypeCounts[0]; 198 | warningCount = m_TypeCounts[1]; 199 | logCount = m_TypeCounts[2]; 200 | } 201 | 202 | public int SetSelectedEntry(int row) 203 | { 204 | m_SelectedInfo = null; 205 | if (row < 0 || row >= m_FilteredInfos.Count) 206 | { 207 | return 0; 208 | } 209 | 210 | m_SelectedInfo = m_FilteredInfos[row]; 211 | return m_SelectedInfo.entry.instanceID; 212 | } 213 | 214 | public bool IsEntrySelected(int row) 215 | { 216 | if (row < 0 || row >= m_FilteredInfos.Count) 217 | { 218 | return false; 219 | } 220 | 221 | return m_FilteredInfos[row] == m_SelectedInfo; 222 | } 223 | 224 | public bool IsSelectedEntryShow() 225 | { 226 | if (m_SelectedInfo != null) 227 | { 228 | return m_FilteredInfos.Contains(m_SelectedInfo); 229 | } 230 | return false; 231 | } 232 | 233 | public int GetSelectedEntryIndex() 234 | { 235 | if (m_SelectedInfo != null) 236 | { 237 | for (int i = 0; i < m_FilteredInfos.Count; i++) 238 | { 239 | if (m_FilteredInfos[i] == m_SelectedInfo) 240 | { 241 | return i; 242 | } 243 | } 244 | } 245 | return -1; 246 | } 247 | 248 | public int GetFirstErrorEntryIndex() 249 | { 250 | for (int i = 0; i < m_FilteredInfos.Count; i++) 251 | { 252 | if (m_FilteredInfos[i].flags == ConsoleFlags.LogLevelError) 253 | { 254 | return i; 255 | } 256 | } 257 | return -1; 258 | } 259 | 260 | public void UpdateEntries() 261 | { 262 | CheckInit(); 263 | if (importWatching) 264 | { 265 | CheckRepaint(CheckSearchStringChanged()); 266 | return; 267 | } 268 | 269 | int flags = CoreLog.LogEntries.consoleFlags; 270 | CoreLog.LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelLog, true); 271 | CoreLog.LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelWarning, true); 272 | CoreLog.LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelError, true); 273 | CoreLog.LogEntries.SetConsoleFlag((int)ConsoleFlags.Collapse, collapse); 274 | int count = CoreLog.LogEntries.GetCount(); 275 | if (count == m_LastEntryCount) 276 | { 277 | CoreLog.LogEntries.consoleFlags = flags; 278 | CheckRepaint(CheckSearchStringChanged()); 279 | return; 280 | } 281 | 282 | if (m_LastEntryCount > count) 283 | { 284 | ClearEntries(); 285 | } 286 | 287 | CoreLog.LogEntries.SetConsoleFlag((int)ConsoleFlags.ShowTimestamp, true); 288 | CoreLog.LogEntries.StartGettingEntries(); 289 | for (int i = m_LastEntryCount; i < count; i++) 290 | { 291 | CoreLog.LogEntry entry = new CoreLog.LogEntry(); 292 | if (!CoreLog.LogEntries.GetEntryInternal(i, entry)) 293 | { 294 | continue; 295 | } 296 | 297 | int mode = 0; 298 | string text = null; 299 | #if UNITY_2017_1_OR_NEWER 300 | CoreLog.LogEntries.GetLinesAndModeFromEntryInternal(i, 10, ref mode, ref text); 301 | #else 302 | CoreLog.LogEntries.GetFirstTwoLinesEntryTextAndModeInternal(i, ref mode, ref text); 303 | #endif 304 | 305 | int entryCount = 0; 306 | if (collapse) 307 | { 308 | entryCount = CoreLog.LogEntries.GetEntryCount(i); 309 | } 310 | AddEntry(i, entry, text, entryCount); 311 | } 312 | CoreLog.LogEntries.EndGettingEntries(); 313 | CoreLog.LogEntries.consoleFlags = flags; 314 | m_LastEntryCount = count; 315 | 316 | CheckSearchStringChanged(); 317 | CheckRepaint(true); 318 | } 319 | 320 | private void ClearEntries() 321 | { 322 | m_SelectedInfo = null; 323 | m_EntryInfos.Clear(); 324 | m_FilteredInfos.Clear(); 325 | m_LastEntryCount = -1; 326 | m_TypeCounts = new[] { 0, 0, 0 }; 327 | } 328 | 329 | private void AddEntry(int row, CoreLog.LogEntry entry, string text, int entryCount) 330 | { 331 | EntryInfo entryInfo = new EntryInfo 332 | { 333 | row = row, 334 | lines = text, 335 | text = GetNumberLines(text), 336 | entryCount = entryCount, 337 | flags = GetConsoleFlagFromMode(entry.mode), 338 | entry = entry 339 | }; 340 | entryInfo.pure = GetPureLines(entryInfo.text, out entryInfo.tagPosInfos); 341 | entryInfo.lower = entryInfo.pure.ToLower(); 342 | m_EntryInfos.Add(entryInfo); 343 | 344 | bool hasSearchString = !string.IsNullOrEmpty(m_SearchString); 345 | string searchStringValue = null; 346 | int searchStringLen = 0; 347 | if (hasSearchString) 348 | { 349 | searchStringValue = m_SearchString.ToLower(); 350 | searchStringLen = searchStringValue.Length; 351 | } 352 | 353 | // 没有将堆栈都进行搜索,以免信息太杂,只根据行数,但是变化行数时不会重新搜索 354 | if (HasFlag((int)entryInfo.flags) && m_CustomFilters.HasFilters(entryInfo.lower) && (!hasSearchString || 355 | (entryInfo.searchIndex = entryInfo.lower.IndexOf(searchStringValue, StringComparison.Ordinal)) != -1)) 356 | { 357 | SearchIndexToTagIndex(entryInfo, searchStringLen); 358 | m_FilteredInfos.Add(entryInfo); 359 | } 360 | 361 | if (entryInfo.flags == ConsoleFlags.LogLevelError) 362 | { 363 | m_TypeCounts[0]++; 364 | } 365 | else if (entryInfo.flags == ConsoleFlags.LogLevelWarning) 366 | { 367 | m_TypeCounts[1]++; 368 | } 369 | else 370 | { 371 | m_TypeCounts[2]++; 372 | } 373 | } 374 | 375 | private void ResetEntriesForNumberLines() 376 | { 377 | foreach (var entryInfo in m_EntryInfos) 378 | { 379 | entryInfo.text = GetNumberLines(entryInfo.lines); 380 | entryInfo.pure = GetPureLines(entryInfo.text, out entryInfo.tagPosInfos); 381 | entryInfo.lower = entryInfo.pure.ToLower(); 382 | } 383 | } 384 | 385 | private void CheckInit() 386 | { 387 | if (m_Init) 388 | { 389 | return; 390 | } 391 | 392 | m_Init = true; 393 | m_ConsoleFlagsComing = EditorPrefs.GetInt(kPrefConsoleFlags, 896); 394 | m_ShowTimestamp = EditorPrefs.GetBool(kPrefShowTimestamp, false); 395 | m_Collapse = EditorPrefs.GetBool(kPrefCollapse, false); 396 | m_WrapperInfos.Clear(); 397 | m_WrapperInfos.AddRange(EditorPrefs.GetString(kPrefWrappers, String.Empty).Split('\n')); 398 | m_CustomFilters.Load(); 399 | } 400 | 401 | private bool CheckSearchStringChanged() 402 | { 403 | if (m_LastSearchStringTime > 1f && m_LastSearchStringTime < EditorApplication.timeSinceStartup) 404 | { 405 | m_LastSearchStringTime = -1f; 406 | if (!string.IsNullOrEmpty(m_SearchString)) 407 | { 408 | if (searchHistory[0].Length == 0) 409 | { 410 | ArrayUtility.RemoveAt(ref searchHistory, 0); 411 | } 412 | else 413 | { 414 | ArrayUtility.Remove(ref searchHistory, m_SearchString); 415 | } 416 | ArrayUtility.Insert(ref searchHistory, 0, m_SearchString); 417 | if (searchHistory.Length > 10) 418 | { 419 | ArrayUtility.RemoveAt(ref searchHistory, 10); 420 | } 421 | } 422 | } 423 | 424 | bool customFiltersChangedValue = m_CustomFilters.IsChanged(); 425 | if (m_SearchString == m_SearchStringComing && m_ConsoleFlags == m_ConsoleFlagsComing && !customFiltersChangedValue) 426 | { 427 | return false; 428 | } 429 | 430 | bool hasSearchString = !string.IsNullOrEmpty(m_SearchStringComing); 431 | bool startsWithValue = hasSearchString && !string.IsNullOrEmpty(m_SearchString) 432 | && m_SearchStringComing.StartsWith(m_SearchString, StringComparison.Ordinal); 433 | bool flagsChangedValue = m_ConsoleFlags != m_ConsoleFlagsComing; 434 | m_ConsoleFlags = m_ConsoleFlagsComing; 435 | string searchStringValue = null; 436 | int searchStringLen = 0; 437 | if (hasSearchString) 438 | { 439 | searchStringValue = m_SearchStringComing.ToLower(); 440 | searchStringLen = searchStringValue.Length; 441 | } 442 | 443 | if (flagsChangedValue || !startsWithValue || customFiltersChangedValue) 444 | { 445 | m_FilteredInfos.Clear(); 446 | 447 | foreach (var entryInfo in m_EntryInfos) 448 | { 449 | if (HasFlag((int)entryInfo.flags) && m_CustomFilters.HasFilters(entryInfo.lower) && (!hasSearchString 450 | || (entryInfo.searchIndex = entryInfo.lower.IndexOf(searchStringValue, StringComparison.Ordinal)) != -1)) 451 | { 452 | SearchIndexToTagIndex(entryInfo, searchStringLen); 453 | m_FilteredInfos.Add(entryInfo); 454 | } 455 | } 456 | } 457 | else 458 | { 459 | for (int i = m_FilteredInfos.Count - 1; i >= 0; i--) 460 | { 461 | if ((m_FilteredInfos[i].searchIndex = m_FilteredInfos[i].lower.IndexOf(searchStringValue, StringComparison.Ordinal)) == -1) 462 | { 463 | m_FilteredInfos.RemoveAt(i); 464 | } 465 | else 466 | { 467 | SearchIndexToTagIndex(m_FilteredInfos[i], searchStringLen); 468 | } 469 | } 470 | } 471 | 472 | m_SearchString = m_SearchStringComing; 473 | if (hasSearchString) 474 | { 475 | m_LastSearchStringTime = EditorApplication.timeSinceStartup + 3f; 476 | } 477 | 478 | if (flagsChangedValue) 479 | { 480 | EditorPrefs.SetInt(kPrefConsoleFlags, m_ConsoleFlags); 481 | } 482 | 483 | if (customFiltersChangedValue) 484 | { 485 | m_CustomFilters.ClearChanged(); 486 | m_CustomFilters.Save(); 487 | } 488 | 489 | searchFrame = IsSelectedEntryShow(); 490 | return true; 491 | } 492 | 493 | private void CheckRepaint(bool repaint) 494 | { 495 | 496 | } 497 | 498 | private bool HasMode(int mode, Mode modeToCheck) { return (mode & (int)modeToCheck) != 0; } 499 | 500 | private ConsoleFlags GetConsoleFlagFromMode(int mode) 501 | { 502 | // Errors 503 | if (HasMode(mode, Mode.Fatal | Mode.Assert | 504 | Mode.Error | Mode.ScriptingError | 505 | Mode.AssetImportError | Mode.ScriptCompileError | 506 | Mode.GraphCompileError | Mode.ScriptingAssertion)) 507 | { 508 | return ConsoleFlags.LogLevelError; 509 | } 510 | // Warnings 511 | if (HasMode(mode, Mode.ScriptCompileWarning | Mode.ScriptingWarning | Mode.AssetImportWarning)) 512 | { 513 | return ConsoleFlags.LogLevelWarning; 514 | } 515 | // Logs 516 | return ConsoleFlags.LogLevelLog; 517 | } 518 | 519 | private string GetNumberLines(string s) 520 | { 521 | int num = numberOfLines; 522 | int i = -1; 523 | for (int j = 1, k = 0; j <= num; j++) 524 | { 525 | i = s.IndexOf('\n', i + 1); 526 | if (i == -1) 527 | { 528 | if (k < num) 529 | { 530 | i = s.Length; 531 | } 532 | break; 533 | } 534 | k++; 535 | } 536 | 537 | if (i != -1) 538 | { 539 | int startIndex = 0; 540 | #if UNITY_2018_1_OR_NEWER 541 | if (!showTimestamp && !importWatching) 542 | { 543 | startIndex = 11; 544 | } 545 | #endif 546 | return s.Substring(startIndex, i - startIndex); 547 | } 548 | return s; 549 | } 550 | 551 | public void ExportLog() 552 | { 553 | string filePath = EditorUtility.SaveFilePanel("Export Log", "", 554 | "Console Log " + string.Format("{0:HHmm}", DateTime.Now) + ".txt", "txt"); 555 | if (string.IsNullOrEmpty(filePath)) 556 | { 557 | return; 558 | } 559 | 560 | StringBuilder sb = new StringBuilder(); 561 | foreach (var entryInfo in m_FilteredInfos) 562 | { 563 | if (entryInfo.flags == ConsoleFlags.LogLevelError) 564 | { 565 | sb.Append("LogStart3----"); 566 | } 567 | else if (entryInfo.flags == ConsoleFlags.LogLevelWarning) 568 | { 569 | sb.Append("LogStart2----"); 570 | } 571 | else 572 | { 573 | sb.Append("LogStart1----"); 574 | } 575 | #if UNITY_2019_2_OR_NEWER 576 | sb.Append(entryInfo.entry.message); 577 | #else 578 | sb.Append(entryInfo.entry.condition); 579 | #endif 580 | sb.Append("\r\n"); // 方便导入的时候,进行识别 581 | } 582 | File.WriteAllText(filePath, sb.ToString()); 583 | } 584 | 585 | public void ImportLog() 586 | { 587 | string filePath = EditorUtility.OpenFilePanelWithFilters("Import Log", "", 588 | new[] { "Log files", "txt,log", "All files", "*" }); 589 | if (string.IsNullOrEmpty(filePath)) 590 | { 591 | return; 592 | } 593 | 594 | ClearEntries(); 595 | importWatching = true; 596 | EditorUtility.DisplayProgressBar("Import Log", String.Empty, 0.2f); 597 | var logText = File.ReadAllText(filePath); 598 | string[] conditions; 599 | if (logText.StartsWith("LogStart", StringComparison.Ordinal) && logText.IndexOf("\nLogStart", StringComparison.Ordinal) != -1) 600 | { 601 | conditions = logText.Split(new[] { "\nLogStart" }, StringSplitOptions.RemoveEmptyEntries); 602 | conditions[0] = conditions[0].Substring(8); 603 | for (int i = 0; i < conditions.Length; i++) 604 | { 605 | var text = conditions[i]; 606 | var entry = new LogEntry { mode = 0 }; 607 | 608 | { 609 | if (text.StartsWith("3----", StringComparison.Ordinal)) 610 | { 611 | entry.mode = (int)Mode.ScriptingError; 612 | } 613 | else if (text.StartsWith("2----", StringComparison.Ordinal)) 614 | { 615 | entry.mode = (int)Mode.ScriptingWarning; 616 | } 617 | else if (text.StartsWith("1----", StringComparison.Ordinal)) 618 | { 619 | entry.mode = (int)Mode.ScriptingLog; 620 | } 621 | 622 | if (entry.mode != 0) 623 | { 624 | text = text.Substring(5); 625 | } 626 | } 627 | #if UNITY_2019_2_OR_NEWER 628 | entry.message = text; 629 | #else 630 | entry.condition = text; 631 | #endif 632 | AddEntry(i, entry, text, 0); 633 | } 634 | } 635 | else 636 | { 637 | conditions = logText.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); 638 | 639 | for (int i = 0; i < conditions.Length; i++) 640 | { 641 | var text = conditions[i]; 642 | var entry = new LogEntry { mode = 0 }; 643 | #if UNITY_2019_2_OR_NEWER 644 | entry.message = text; 645 | #else 646 | entry.condition = text; 647 | #endif 648 | AddEntry(i, entry, text, 0); 649 | } 650 | } 651 | EditorUtility.DisplayProgressBar("Import Log", String.Empty, 0.4f); 652 | 653 | EditorUtility.ClearProgressBar(); 654 | } 655 | 656 | #region HTMLTag 657 | 658 | private const int kTagQuadIndex = 5; 659 | 660 | private readonly string[] m_TagStrings = new string[] 661 | { 662 | "b", 663 | "i", 664 | "color", 665 | "size", 666 | "material", 667 | "quad", 668 | "x", 669 | "y", 670 | "width", 671 | "height", 672 | }; 673 | 674 | private readonly StringBuilder m_StringBuilder = new StringBuilder(); 675 | private readonly Stack m_TagStack = new Stack(); 676 | 677 | private int GetTagIndex(string input, ref int pos, out bool closing) 678 | { 679 | closing = false; 680 | if (input[pos] == '<') 681 | { 682 | int inputLen = input.Length; 683 | int nextPos = pos + 1; 684 | if (nextPos == inputLen) 685 | { 686 | return -1; 687 | } 688 | 689 | closing = input[nextPos] == '/'; 690 | if (closing) 691 | { 692 | nextPos++; 693 | } 694 | 695 | for (int i = 0; i < m_TagStrings.Length; i++) 696 | { 697 | var tagString = m_TagStrings[i]; 698 | bool find = true; 699 | 700 | for (int j = 0; j < tagString.Length; j++) 701 | { 702 | int pingPos = nextPos + j; 703 | if (pingPos == inputLen || char.ToLower(input[pingPos]) != tagString[j]) 704 | { 705 | find = false; 706 | break; 707 | } 708 | } 709 | 710 | if (find) 711 | { 712 | int endPos = nextPos + tagString.Length; 713 | if (endPos == inputLen) 714 | { 715 | continue; 716 | } 717 | 718 | if ((!closing && input[endPos] == '=') || (input[endPos] == ' ' && i == kTagQuadIndex)) 719 | { 720 | while (input[endPos] != '>' && endPos < inputLen) 721 | { 722 | endPos++; 723 | } 724 | } 725 | 726 | if (input[endPos] != '>') 727 | { 728 | continue; 729 | } 730 | 731 | pos = endPos; 732 | return i; 733 | } 734 | } 735 | } 736 | return -1; 737 | } 738 | 739 | private string GetPureLines(string input, out List posList) 740 | { 741 | m_StringBuilder.Length = 0; 742 | m_TagStack.Clear(); 743 | posList = null; 744 | 745 | int preStrPos = 0; 746 | int pos = 0; 747 | while (pos < input.Length) 748 | { 749 | int oldPos = pos; 750 | bool closing; 751 | int tagIndex = GetTagIndex(input, ref pos, out closing); 752 | if (tagIndex != -1) 753 | { 754 | if (closing) 755 | { 756 | if (m_TagStack.Count == 0 || m_TagStack.Pop() != tagIndex) 757 | { 758 | posList = null; 759 | return input; 760 | } 761 | } 762 | 763 | if (posList == null) 764 | { 765 | posList = new List(); 766 | } 767 | posList.Add(oldPos); 768 | posList.Add(pos); 769 | 770 | if (preStrPos != oldPos) 771 | { 772 | m_StringBuilder.Append(input, preStrPos, oldPos - preStrPos); 773 | } 774 | preStrPos = pos + 1; 775 | 776 | if (closing || tagIndex == kTagQuadIndex) 777 | { 778 | continue; 779 | } 780 | 781 | m_TagStack.Push(tagIndex); 782 | } 783 | pos++; 784 | } 785 | 786 | if (m_TagStack.Count > 0) 787 | { 788 | posList = null; 789 | return input; 790 | } 791 | 792 | if (preStrPos > 0 && preStrPos < input.Length) 793 | { 794 | m_StringBuilder.Append(input, preStrPos, input.Length - preStrPos); 795 | } 796 | if (m_StringBuilder.Length > 0) 797 | { 798 | return m_StringBuilder.ToString(); 799 | } 800 | 801 | return input; 802 | } 803 | 804 | private int GetOriginalCharIndex(int idx, List posList) 805 | { 806 | if (posList == null || posList.Count == 0) 807 | { 808 | return idx; 809 | } 810 | 811 | int idx2 = 0; 812 | for (int i = 0; i < posList.Count && (i + 1) < posList.Count;) 813 | { 814 | int idx1 = idx2; 815 | if ((i - 1) > 0) 816 | { 817 | idx2 += posList[i] - posList[i - 1] - 1; 818 | } 819 | else 820 | { 821 | idx2 = posList[i] - 1; 822 | } 823 | 824 | if (idx >= idx1 && idx <= idx2) 825 | { 826 | if ((i - 1) > 0) 827 | { 828 | return posList[i - 1] + idx - idx1; 829 | } 830 | 831 | return idx; 832 | } 833 | 834 | i += 2; 835 | } 836 | 837 | return posList[posList.Count - 1] + idx - idx2; 838 | } 839 | 840 | private void SearchIndexToTagIndex(EntryInfo entryInfo, int searchLength) 841 | { 842 | if (entryInfo.searchIndex == -1) 843 | { 844 | return; 845 | } 846 | 847 | entryInfo.searchEndIndex = GetOriginalCharIndex(entryInfo.searchIndex + searchLength, 848 | entryInfo.tagPosInfos); 849 | entryInfo.searchIndex = GetOriginalCharIndex(entryInfo.searchIndex, entryInfo.tagPosInfos); 850 | } 851 | 852 | #endregion 853 | 854 | #region CustomFilters 855 | 856 | public class CustomFiltersItem 857 | { 858 | private string m_Filter; 859 | private bool m_Toggle; 860 | 861 | public bool changed { get; set; } 862 | 863 | public string filter 864 | { 865 | get { return m_Filter; } 866 | set 867 | { 868 | if (value != m_Filter) 869 | { 870 | m_Filter = value.ToLower(); 871 | if (toggle) 872 | { 873 | changed = true; 874 | } 875 | } 876 | } 877 | } 878 | 879 | public bool toggle 880 | { 881 | get { return m_Toggle; } 882 | set 883 | { 884 | if (value != m_Toggle) 885 | { 886 | m_Toggle = value; 887 | changed = true; 888 | } 889 | } 890 | } 891 | } 892 | 893 | public class CustomFiltersGroup 894 | { 895 | public readonly List filters = new List(); 896 | public bool changed { get; set; } 897 | 898 | public bool IsChanged() 899 | { 900 | foreach (var filter in filters) 901 | { 902 | if (filter.changed) 903 | { 904 | return true; 905 | } 906 | } 907 | return changed; 908 | } 909 | 910 | public void ClearChanged() 911 | { 912 | changed = false; 913 | foreach (var filter in filters) 914 | { 915 | filter.changed = false; 916 | } 917 | } 918 | 919 | public bool HasFilters(string input) 920 | { 921 | foreach (var filter in filters) 922 | { 923 | if (filter.toggle && !input.Contains(filter.filter)) 924 | { 925 | return false; 926 | } 927 | } 928 | 929 | return true; 930 | } 931 | 932 | public void Load() 933 | { 934 | filters.Clear(); 935 | var val = EditorPrefs.GetString(kPrefCustomFilters, String.Empty); 936 | if (string.IsNullOrEmpty(val)) 937 | { 938 | return; 939 | } 940 | 941 | var vals = val.Split('\n'); 942 | try 943 | { 944 | for (int i = 0; i < vals.Length && (i + 1) < vals.Length; i++) 945 | { 946 | var item = new CustomFiltersItem { filter = vals[i], toggle = bool.Parse(vals[i + 1]) }; 947 | filters.Add(item); 948 | i++; 949 | } 950 | } 951 | catch 952 | { 953 | // ignored 954 | } 955 | } 956 | 957 | public void Save() 958 | { 959 | StringBuilder sb = new StringBuilder(); 960 | foreach (var filter in filters) 961 | { 962 | sb.Append(filter.filter); 963 | sb.Append('\n'); 964 | sb.Append(filter.toggle.ToString()); 965 | sb.Append('\n'); 966 | } 967 | EditorPrefs.SetString(kPrefCustomFilters, sb.ToString()); 968 | } 969 | } 970 | 971 | public CustomFiltersGroup customFilters 972 | { 973 | get { return m_CustomFilters; } 974 | } 975 | 976 | #endregion 977 | 978 | #region Stacktrace 979 | 980 | internal class Constants 981 | { 982 | public static string colorNamespace, colorNamespaceAlpha; 983 | public static string colorClass, colorClassAlpha; 984 | public static string colorMethod, colorMethodAlpha; 985 | public static string colorParameters, colorParametersAlpha; 986 | public static string colorPath, colorPathAlpha; 987 | public static string colorFilename, colorFilenameAlpha; 988 | } 989 | 990 | private class StacktraceLineInfo 991 | { 992 | public string plain; 993 | public string text; 994 | public string wrapper; 995 | public string filePath; 996 | public int lineNum; 997 | } 998 | 999 | public bool StacktraceListView_IsExist() 1000 | { 1001 | if (m_SelectedInfo == null || m_SelectedInfo.stacktraceLineInfos == null) 1002 | { 1003 | return false; 1004 | } 1005 | 1006 | return true; 1007 | } 1008 | 1009 | public int StacktraceListView_GetCount() 1010 | { 1011 | if (StacktraceListView_IsExist() && IsSelectedEntryShow()) 1012 | { 1013 | return m_SelectedInfo.stacktraceLineInfos.Count; 1014 | } 1015 | 1016 | return 0; 1017 | } 1018 | 1019 | public string StacktraceListView_GetLine(int row) 1020 | { 1021 | if (StacktraceListView_IsExist()) 1022 | { 1023 | return m_SelectedInfo.stacktraceLineInfos[row].text; 1024 | } 1025 | 1026 | return String.Empty; 1027 | } 1028 | 1029 | public float StacktraceListView_GetMaxWidth(GUIContent tempContent, GUIStyle tempStyle) 1030 | { 1031 | if (m_SelectedInfo == null || !IsSelectedEntryShow()) 1032 | { 1033 | return 1f; 1034 | } 1035 | 1036 | if (!StacktraceListView_IsExist()) 1037 | { 1038 | StacktraceListView_Parse(m_SelectedInfo); 1039 | } 1040 | 1041 | var maxLine = -1; 1042 | var maxLineLen = -1; 1043 | for (int i = 0; i < m_SelectedInfo.stacktraceLineInfos.Count; i++) 1044 | { 1045 | if (maxLineLen < m_SelectedInfo.stacktraceLineInfos[i].plain.Length) 1046 | { 1047 | maxLineLen = m_SelectedInfo.stacktraceLineInfos[i].plain.Length; 1048 | maxLine = i; 1049 | } 1050 | } 1051 | 1052 | float maxWidth = 1f; 1053 | if (maxLine != -1) 1054 | { 1055 | tempContent.text = m_SelectedInfo.stacktraceLineInfos[maxLine].plain; 1056 | maxWidth = tempStyle.CalcSize(tempContent).x; 1057 | } 1058 | 1059 | return maxWidth; 1060 | } 1061 | 1062 | private void StacktraceListView_Parse(EntryInfo entryInfo) 1063 | { 1064 | #if UNITY_2019_2_OR_NEWER 1065 | var lines = entryInfo.entry.message.Split(new char[] { '\n' }, StringSplitOptions.None); 1066 | #else 1067 | var lines = entryInfo.entry.condition.Split(new char[] { '\n' }, StringSplitOptions.None); 1068 | #endif 1069 | entryInfo.stacktraceLineInfos = new List(lines.Length); 1070 | 1071 | string rootDirectory = System.IO.Path.Combine(Application.dataPath, ".."); 1072 | Uri uriRoot = new Uri(rootDirectory); 1073 | string textBeforeFilePath = ") (at "; 1074 | string textUnityEngineDebug = "UnityEngine.Debug"; 1075 | #if UNITY_2019_1_OR_NEWER 1076 | string fileInBuildSlave = "D:/unity/"; 1077 | #else 1078 | string fileInBuildSlave = "C:/buildslave/unity/"; 1079 | #endif 1080 | string luaCFunction = "[C]"; 1081 | string luaMethodBefore = ": in function "; 1082 | string luaFileExt = ".lua"; 1083 | string luaAssetPath = "Assets/Lua/"; 1084 | for (int i = 0; i < lines.Length; i++) 1085 | { 1086 | var line = lines[i]; 1087 | if (i == lines.Length - 1 && string.IsNullOrEmpty(line)) 1088 | { 1089 | continue; 1090 | } 1091 | if (line.StartsWith(textUnityEngineDebug)) 1092 | { 1093 | continue; 1094 | } 1095 | 1096 | StacktraceLineInfo info = new StacktraceLineInfo(); 1097 | info.plain = line; 1098 | info.text = info.plain; 1099 | entryInfo.stacktraceLineInfos.Add(info); 1100 | 1101 | if (i == 0) 1102 | { 1103 | continue; 1104 | } 1105 | 1106 | if (!StacktraceListView_Parse_CSharp(line, info, textBeforeFilePath, fileInBuildSlave, uriRoot)) 1107 | { 1108 | StacktraceListView_Parse_Lua(line, info, luaCFunction, luaMethodBefore, luaFileExt, luaAssetPath); 1109 | } 1110 | } 1111 | } 1112 | 1113 | private bool StacktraceListView_Parse_CSharp(string line, StacktraceLineInfo info, 1114 | string textBeforeFilePath, string fileInBuildSlave, Uri uriRoot) 1115 | { 1116 | int methodLastIndex = line.IndexOf('('); 1117 | if (methodLastIndex <= 0) 1118 | { 1119 | return false; 1120 | } 1121 | int argsLastIndex = line.IndexOf(')', methodLastIndex); 1122 | if (argsLastIndex <= 0) 1123 | { 1124 | return false; 1125 | } 1126 | int methodFirstIndex = line.LastIndexOf(':', methodLastIndex); 1127 | if (methodFirstIndex <= 0) 1128 | { 1129 | methodFirstIndex = line.LastIndexOf('.', methodLastIndex); 1130 | if (methodFirstIndex <= 0) 1131 | { 1132 | return false; 1133 | } 1134 | } 1135 | string methodString = line.Substring(methodFirstIndex + 1, methodLastIndex - methodFirstIndex - 1); 1136 | 1137 | string classString; 1138 | string namespaceString = String.Empty; 1139 | int classFirstIndex = line.LastIndexOf('.', methodFirstIndex - 1); 1140 | if (classFirstIndex <= 0) 1141 | { 1142 | classString = line.Substring(0, methodFirstIndex + 1); 1143 | } 1144 | else 1145 | { 1146 | classString = line.Substring(classFirstIndex + 1, methodFirstIndex - classFirstIndex); 1147 | namespaceString = line.Substring(0, classFirstIndex + 1); 1148 | } 1149 | 1150 | string argsString = line.Substring(methodLastIndex, argsLastIndex - methodLastIndex + 1); 1151 | string fileString = String.Empty; 1152 | string fileNameString = String.Empty; 1153 | string fileLineString = String.Empty; 1154 | bool alphaColor = true; 1155 | 1156 | int filePathIndex = line.IndexOf(textBeforeFilePath, argsLastIndex, StringComparison.Ordinal); 1157 | if (filePathIndex > 0) 1158 | { 1159 | filePathIndex += textBeforeFilePath.Length; 1160 | if (line[filePathIndex] != '<') // sometimes no url is given, just an id between <>, we can't do an hyperlink 1161 | { 1162 | string filePathPart = line.Substring(filePathIndex); 1163 | int lineIndex = filePathPart.LastIndexOf(":", StringComparison.Ordinal); // LastIndex because the url can contain ':' ex:"C:" 1164 | if (lineIndex > 0) 1165 | { 1166 | int endLineIndex = filePathPart.LastIndexOf(")", StringComparison.Ordinal); // LastIndex because files or folder in the url can contain ')' 1167 | if (endLineIndex > 0) 1168 | { 1169 | string lineString = 1170 | filePathPart.Substring(lineIndex + 1, (endLineIndex) - (lineIndex + 1)); 1171 | string filePath = filePathPart.Substring(0, lineIndex); 1172 | 1173 | bool isInBuildSlave = filePath.StartsWith(fileInBuildSlave, StringComparison.Ordinal); 1174 | if (!isInBuildSlave) 1175 | { 1176 | alphaColor = false; 1177 | } 1178 | 1179 | info.filePath = filePath; 1180 | info.lineNum = int.Parse(lineString); 1181 | 1182 | if (filePath.Length > 2 && filePath[1] == ':' && !isInBuildSlave) 1183 | { 1184 | Uri uriFile = new Uri(filePath); 1185 | Uri relativeUri = uriRoot.MakeRelativeUri(uriFile); 1186 | string relativePath = relativeUri.ToString(); 1187 | if (!string.IsNullOrEmpty(relativePath)) 1188 | { 1189 | info.plain = info.plain.Replace(filePath, relativePath); 1190 | filePath = relativePath; 1191 | } 1192 | } 1193 | 1194 | fileNameString = System.IO.Path.GetFileName(filePath); 1195 | fileString = textBeforeFilePath.Substring(1) + filePath.Substring(0, filePath.Length - fileNameString.Length); 1196 | fileLineString = filePathPart.Substring(lineIndex, endLineIndex - lineIndex + 1); 1197 | } 1198 | } 1199 | } 1200 | else 1201 | { 1202 | fileString = line.Substring(argsLastIndex + 1); 1203 | } 1204 | } 1205 | 1206 | if (alphaColor) 1207 | { 1208 | info.text = 1209 | string.Format("{1}", Constants.colorNamespaceAlpha, namespaceString) + 1210 | string.Format("{1}", Constants.colorClassAlpha, classString) + 1211 | string.Format("{1}", Constants.colorMethodAlpha, methodString) + 1212 | string.Format("{1}", Constants.colorParametersAlpha, argsString) + 1213 | string.Format("{1}", Constants.colorPathAlpha, fileString) + 1214 | string.Format("{1}", Constants.colorFilenameAlpha, fileNameString) + 1215 | string.Format("{1}", Constants.colorPathAlpha, fileLineString); 1216 | } 1217 | else 1218 | { 1219 | info.text = string.Format("{1}", Constants.colorNamespace, namespaceString) + 1220 | string.Format("{1}", Constants.colorClass, classString) + 1221 | string.Format("{1}", Constants.colorMethod, methodString) + 1222 | string.Format("{1}", Constants.colorParameters, argsString) + 1223 | string.Format("{1}", Constants.colorPath, fileString) + 1224 | string.Format("{1}", Constants.colorFilename, fileNameString) + 1225 | string.Format("{1}", Constants.colorPath, fileLineString); 1226 | info.wrapper = namespaceString + classString; 1227 | if (info.wrapper.Length > 0) 1228 | { 1229 | info.wrapper = info.wrapper.Remove(info.wrapper.Length - 1); 1230 | } 1231 | } 1232 | 1233 | return true; 1234 | } 1235 | 1236 | private bool StacktraceListView_Parse_Lua(string line, StacktraceLineInfo info, 1237 | string luaCFunction, string luaMethodBefore, string luaFileExt, string luaAssetPath) 1238 | { 1239 | if (string.IsNullOrEmpty(line) || line[0] != ' ') 1240 | { 1241 | return false; 1242 | } 1243 | 1244 | string preMethodString = line; 1245 | string methodString = String.Empty; 1246 | int methodFirstIndex = line.IndexOf(luaMethodBefore, StringComparison.Ordinal); 1247 | if (methodFirstIndex > 0) 1248 | { 1249 | methodString = line.Substring(methodFirstIndex + luaMethodBefore.Length); 1250 | preMethodString = preMethodString.Remove(methodFirstIndex + luaMethodBefore.Length); 1251 | } 1252 | 1253 | bool cFunction = line.IndexOf(luaCFunction, 1, StringComparison.Ordinal) == 1; 1254 | if (!cFunction) 1255 | { 1256 | int lineIndex = line.IndexOf(':'); 1257 | if (lineIndex > 0) 1258 | { 1259 | int endLineIndex = line.IndexOf(':', lineIndex + 1); 1260 | if (endLineIndex > 0) 1261 | { 1262 | string lineString = 1263 | line.Substring(lineIndex + 1, (endLineIndex) - (lineIndex + 1)); 1264 | string filePath = line.Substring(1, lineIndex - 1); 1265 | if (!filePath.EndsWith(luaFileExt, StringComparison.Ordinal)) 1266 | { 1267 | filePath += luaFileExt; 1268 | } 1269 | 1270 | if (!int.TryParse(lineString, out info.lineNum)) 1271 | { 1272 | return false; 1273 | } 1274 | info.filePath = luaAssetPath + filePath; 1275 | 1276 | string namespaceString = String.Empty; 1277 | int classFirstIndex = filePath.LastIndexOf('/'); 1278 | if (classFirstIndex > 0) 1279 | { 1280 | namespaceString = filePath.Substring(0, classFirstIndex + 1); 1281 | } 1282 | 1283 | string classString = filePath.Substring(classFirstIndex + 1, 1284 | filePath.Length - namespaceString.Length - luaFileExt.Length); 1285 | 1286 | 1287 | info.text = string.Format(" {1}", Constants.colorNamespace, 1288 | namespaceString) + 1289 | string.Format("{1}", Constants.colorClass, classString) + 1290 | string.Format(":{1}", Constants.colorPath, lineString) + 1291 | string.Format("{1}", Constants.colorPath, luaMethodBefore) + 1292 | string.Format("{1}", Constants.colorMethod, methodString); 1293 | } 1294 | } 1295 | } 1296 | else 1297 | { 1298 | info.text = string.Format("{1}", Constants.colorPathAlpha, preMethodString) + 1299 | string.Format("{1}", Constants.colorMethodAlpha, methodString); 1300 | } 1301 | 1302 | return true; 1303 | } 1304 | 1305 | public bool StacktraceListView_CanOpen(int stacktraceLineInfoIndex) 1306 | { 1307 | if (!StacktraceListView_IsExist()) 1308 | { 1309 | return false; 1310 | } 1311 | 1312 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1313 | { 1314 | return !string.IsNullOrEmpty(m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].filePath); 1315 | } 1316 | return false; 1317 | } 1318 | 1319 | public bool StacktraceListView_CanWrapper(int stacktraceLineInfoIndex) 1320 | { 1321 | if (!StacktraceListView_IsExist()) 1322 | { 1323 | return false; 1324 | } 1325 | 1326 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1327 | { 1328 | return !string.IsNullOrEmpty(m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].wrapper); 1329 | } 1330 | return false; 1331 | } 1332 | 1333 | public bool StacktraceListView_IsWrapper(int stacktraceLineInfoIndex) 1334 | { 1335 | if (!StacktraceListView_IsExist()) 1336 | { 1337 | return false; 1338 | } 1339 | 1340 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1341 | { 1342 | return !string.IsNullOrEmpty(m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].wrapper) && 1343 | m_WrapperInfos.Contains(m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].wrapper); 1344 | } 1345 | return false; 1346 | } 1347 | 1348 | public void StacktraceListView_RowGotDoubleClicked() 1349 | { 1350 | if (!StacktraceListView_IsExist()) 1351 | { 1352 | return; 1353 | } 1354 | 1355 | for (var i = 0; i < m_SelectedInfo.stacktraceLineInfos.Count; i++) 1356 | { 1357 | var stacktraceLineInfo = m_SelectedInfo.stacktraceLineInfos[i]; 1358 | if (!string.IsNullOrEmpty(stacktraceLineInfo.filePath)) 1359 | { 1360 | if (string.IsNullOrEmpty(stacktraceLineInfo.wrapper) || !m_WrapperInfos.Contains(stacktraceLineInfo.wrapper)) 1361 | { 1362 | StacktraceListView_Open(i); 1363 | break; 1364 | } 1365 | } 1366 | } 1367 | } 1368 | 1369 | public void StacktraceListView_Open(object userData) 1370 | { 1371 | if (!StacktraceListView_IsExist()) 1372 | { 1373 | return; 1374 | } 1375 | 1376 | var stacktraceLineInfoIndex = (int)userData; 1377 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1378 | { 1379 | var filePath = m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].filePath; 1380 | var lineNum = m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].lineNum; 1381 | ScriptAssetOpener.OpenAsset(filePath, lineNum); 1382 | } 1383 | } 1384 | 1385 | public void StacktraceListView_Wrapper(object userData) 1386 | { 1387 | if (!StacktraceListView_IsExist()) 1388 | { 1389 | return; 1390 | } 1391 | 1392 | var stacktraceLineInfoIndex = (int)userData; 1393 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1394 | { 1395 | var wrapper = m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].wrapper; 1396 | if (m_WrapperInfos.Contains(wrapper)) 1397 | { 1398 | m_WrapperInfos.Remove(wrapper); 1399 | } 1400 | else 1401 | { 1402 | m_WrapperInfos.Add(wrapper); 1403 | } 1404 | StringBuilder sb = new StringBuilder(); 1405 | foreach (var info in m_WrapperInfos) 1406 | { 1407 | if (!string.IsNullOrEmpty(info)) 1408 | { 1409 | sb.Append(info); 1410 | sb.Append('\n'); 1411 | } 1412 | } 1413 | EditorPrefs.SetString(kPrefWrappers, sb.ToString()); 1414 | } 1415 | } 1416 | 1417 | public void StacktraceListView_Copy(object userData) 1418 | { 1419 | if (!StacktraceListView_IsExist()) 1420 | { 1421 | return; 1422 | } 1423 | 1424 | var stacktraceLineInfoIndex = (int)userData; 1425 | if (stacktraceLineInfoIndex < m_SelectedInfo.stacktraceLineInfos.Count) 1426 | { 1427 | EditorGUIUtility.systemCopyBuffer = m_SelectedInfo.stacktraceLineInfos[stacktraceLineInfoIndex].plain; 1428 | } 1429 | } 1430 | 1431 | public void StacktraceListView_CopyAll() 1432 | { 1433 | if (!StacktraceListView_IsExist() || !IsSelectedEntryShow()) 1434 | { 1435 | return; 1436 | } 1437 | 1438 | #if UNITY_2019_2_OR_NEWER 1439 | EditorGUIUtility.systemCopyBuffer = m_SelectedInfo.entry.message; 1440 | #else 1441 | EditorGUIUtility.systemCopyBuffer = m_SelectedInfo.entry.condition; 1442 | #endif 1443 | } 1444 | 1445 | #endregion 1446 | } 1447 | } 1448 | } -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/LogEntries.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9849f41742edce44197d33c072083d54 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/ScriptAssetOpener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using System.Threading; 5 | using Microsoft.Win32; 6 | using UnityEditor; 7 | using UnityEditorInternal; 8 | #if UNITY_2017_1_OR_NEWER 9 | using UnityEditor.PackageManager; 10 | #endif 11 | 12 | namespace ConsoleTiny 13 | { 14 | public class ScriptAssetOpener 15 | { 16 | private static bool IsNotWindowsEditor() 17 | { 18 | return UnityEngine.Application.platform != UnityEngine.RuntimePlatform.WindowsEditor; 19 | } 20 | 21 | private static string QuotePathIfNeeded(string path) 22 | { 23 | if (!path.Contains(" ")) 24 | { 25 | return path; 26 | } 27 | return "\"" + path + "\""; 28 | } 29 | 30 | public static bool OpenAsset(string file, int line) 31 | { 32 | if (string.IsNullOrEmpty(file) || file == "None") 33 | { 34 | return false; 35 | } 36 | if (file.StartsWith("Assets/", StringComparison.Ordinal)) 37 | { 38 | var ext = Path.GetExtension(file).ToLower(); 39 | if (ext == ".lua" && TryOpenLuaFile(file, line)) 40 | { 41 | return true; 42 | } 43 | 44 | var obj = AssetDatabase.LoadAssetAtPath(file); 45 | if (obj) 46 | { 47 | AssetDatabase.OpenAsset(obj, line); 48 | return true; 49 | } 50 | 51 | return false; 52 | } 53 | 54 | char separatorChar = '\\'; 55 | string fileFullPath; 56 | if (IsNotWindowsEditor()) 57 | { 58 | separatorChar = '/'; 59 | fileFullPath = Path.GetFullPath(file); 60 | } 61 | else 62 | { 63 | fileFullPath = Path.GetFullPath(file.Replace('/', separatorChar)); 64 | } 65 | #if UNITY_2020_1_OR_NEWER 66 | var packageInfos = UnityEditor.PackageManager.PackageInfo.GetAll(); 67 | foreach (var packageInfo in packageInfos) 68 | { 69 | if (fileFullPath.StartsWith(packageInfo.resolvedPath, StringComparison.Ordinal)) 70 | { 71 | InternalEditorUtility.OpenFileAtLineExternal(fileFullPath, line); 72 | return true; 73 | } 74 | } 75 | #elif UNITY_2018_1_OR_NEWER 76 | var packageInfos = Packages.GetAll(); 77 | foreach (var packageInfo in packageInfos) 78 | { 79 | if (fileFullPath.StartsWith(packageInfo.resolvedPath, StringComparison.Ordinal)) 80 | { 81 | InternalEditorUtility.OpenFileAtLineExternal(fileFullPath, line); 82 | return true; 83 | } 84 | } 85 | #elif UNITY_2017_1_OR_NEWER 86 | // TODO 87 | #endif 88 | 89 | // 别人编译的DLL,不存在文件路径,那么就以工程路径拼接组装来尝试获取本地路径 90 | if (!File.Exists(fileFullPath)) 91 | { 92 | string directoryName = Directory.GetCurrentDirectory(); 93 | while (true) 94 | { 95 | if (string.IsNullOrEmpty(directoryName) || !Directory.Exists(directoryName)) 96 | { 97 | return false; 98 | } 99 | 100 | int pos = fileFullPath.IndexOf(separatorChar); 101 | while (pos != -1) 102 | { 103 | string testFullPath = Path.Combine(directoryName, fileFullPath.Substring(pos + 1)); 104 | if (File.Exists(testFullPath) && TryOpenVisualStudioFile(testFullPath, line)) 105 | { 106 | return true; 107 | } 108 | 109 | pos = fileFullPath.IndexOf(separatorChar, pos + 1); 110 | } 111 | 112 | directoryName = Path.GetDirectoryName(directoryName); 113 | } 114 | } 115 | 116 | return TryOpenVisualStudioFile(fileFullPath, line); 117 | } 118 | 119 | private static bool TryOpenVisualStudioFile(string file, int line) 120 | { 121 | string dirPath = file; 122 | 123 | do 124 | { 125 | dirPath = Path.GetDirectoryName(dirPath); 126 | if (!string.IsNullOrEmpty(dirPath) && Directory.Exists(dirPath)) 127 | { 128 | var files = Directory.GetFiles(dirPath, "*.sln", SearchOption.TopDirectoryOnly); 129 | if (files.Length > 0) 130 | { 131 | OpenVisualStudioFile(files[0], file, line); 132 | return true; 133 | } 134 | } 135 | else 136 | { 137 | break; 138 | } 139 | } while (true); 140 | 141 | return false; 142 | } 143 | 144 | private static void OpenVisualStudioFile(string projectPath, string file, int line) 145 | { 146 | #if UNITY_2017_1_OR_NEWER 147 | string vsPath = ScriptEditorUtility.GetExternalScriptEditor(); 148 | #else 149 | string vsPath = InternalEditorUtility.GetExternalScriptEditor(); 150 | #endif 151 | if (IsNotWindowsEditor()) 152 | { 153 | Process.Start("open", "-a " + QuotePathIfNeeded(vsPath) + " " + QuotePathIfNeeded(file)); 154 | return; 155 | } 156 | 157 | if (string.IsNullOrEmpty(vsPath) || !File.Exists(vsPath)) 158 | { 159 | return; 160 | } 161 | string exePath = String.Empty; 162 | 163 | #if UNITY_2020_1_OR_NEWER 164 | var packageInfos = UnityEditor.PackageManager.PackageInfo.GetAll(); 165 | foreach (var packageInfo in packageInfos) 166 | { 167 | if (packageInfo.name == "com.wuhuan.consoletiny") 168 | { 169 | exePath = packageInfo.resolvedPath; 170 | break; 171 | } 172 | } 173 | #elif UNITY_2018_1_OR_NEWER 174 | var packageInfos = Packages.GetAll(); 175 | foreach (var packageInfo in packageInfos) 176 | { 177 | if (packageInfo.name == "com.wuhuan.consoletiny") 178 | { 179 | exePath = packageInfo.resolvedPath; 180 | break; 181 | } 182 | } 183 | 184 | #elif UNITY_2017_1_OR_NEWER 185 | // TODO 186 | exePath = "../../PackagesCustom/com.wuhuan.consoletiny"; 187 | #endif 188 | 189 | if (!string.IsNullOrEmpty(exePath)) 190 | { 191 | // https://github.com/akof1314/VisualStudioFileOpenTool 192 | exePath = exePath + "\\Editor\\VisualStudioFileOpenTool.exe"; 193 | if (!File.Exists(exePath)) 194 | { 195 | return; 196 | } 197 | 198 | ThreadPool.QueueUserWorkItem(_ => 199 | { 200 | OpenVisualStudioFileInter(exePath, vsPath, projectPath, file, line); 201 | }); 202 | } 203 | } 204 | 205 | private static void OpenVisualStudioFileInter(string exePath, string vsPath, string projectPath, string file, int line) 206 | { 207 | Process.Start(new ProcessStartInfo 208 | { 209 | FileName = exePath, 210 | Arguments = String.Format("{0} {1} {2} {3}", 211 | QuotePathIfNeeded(vsPath), QuotePathIfNeeded(projectPath), QuotePathIfNeeded(file), line), 212 | UseShellExecute = false, 213 | CreateNoWindow = true 214 | }); 215 | } 216 | 217 | private const string kLuaScriptEditor = "ConsoleTiny_LuaScriptEditor"; 218 | 219 | public static void SetLuaScriptEditor() 220 | { 221 | string filePath = EditorUtility.OpenFilePanel("Lua Script Editor", "", InternalEditorUtility.GetApplicationExtensionForRuntimePlatform(UnityEngine.Application.platform)); 222 | if (string.IsNullOrEmpty(filePath)) 223 | { 224 | return; 225 | } 226 | 227 | if (IsNotWindowsEditor()) 228 | { 229 | if (filePath.EndsWith(".app", StringComparison.Ordinal)) 230 | { 231 | filePath = Path.Combine(filePath, "Contents/MacOS"); 232 | var filePaths = Directory.GetFiles(filePath); 233 | if (filePaths.Length > 0) 234 | { 235 | filePath = filePaths[0]; 236 | } 237 | } 238 | } 239 | 240 | EditorPrefs.SetString(kLuaScriptEditor, filePath); 241 | } 242 | 243 | private static bool TryOpenLuaFile(string file, int line) 244 | { 245 | string luaPath = LuaExecutablePath(); 246 | if (string.IsNullOrEmpty(luaPath) || !File.Exists(luaPath)) 247 | { 248 | return false; 249 | } 250 | 251 | ThreadPool.QueueUserWorkItem(_ => 252 | { 253 | OpenLuaFileInter(luaPath, file, line); 254 | }); 255 | return true; 256 | } 257 | 258 | private static void OpenLuaFileInter(string exePath, string file, int line) 259 | { 260 | string arg = string.Format("{0}:{1}", QuotePathIfNeeded(file), line); 261 | if (exePath.EndsWith("idea.exe", StringComparison.Ordinal) || 262 | exePath.EndsWith("idea64.exe", StringComparison.Ordinal) || 263 | exePath.EndsWith("idea", StringComparison.Ordinal)) 264 | { 265 | arg = String.Format("--line {1} {0}", QuotePathIfNeeded(file), line); 266 | } 267 | 268 | Process.Start(new ProcessStartInfo 269 | { 270 | FileName = exePath, 271 | Arguments = arg, 272 | UseShellExecute = false, 273 | CreateNoWindow = true 274 | }); 275 | } 276 | 277 | private static string LuaExecutablePath() 278 | { 279 | string path = EditorPrefs.GetString(kLuaScriptEditor, string.Empty); 280 | if (!string.IsNullOrEmpty(path)) 281 | { 282 | return path; 283 | } 284 | if (IsNotWindowsEditor()) 285 | { 286 | return String.Empty; 287 | } 288 | 289 | using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\.lua\\UserChoice")) 290 | { 291 | if (registryKey != null) 292 | { 293 | string val = registryKey.GetValue("Progid") as string; 294 | if (!string.IsNullOrEmpty(val)) 295 | { 296 | val = "Software\\Classes\\" + val + "\\shell\\open\\command"; 297 | using (RegistryKey registryKey2 = Registry.CurrentUser.OpenSubKey(val)) 298 | { 299 | string val3 = LuaExecutablePathInter(registryKey2); 300 | if (!string.IsNullOrEmpty(val3)) 301 | { 302 | return val3; 303 | } 304 | } 305 | } 306 | } 307 | } 308 | 309 | using (RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(".lua")) 310 | { 311 | if (registryKey != null) 312 | { 313 | string val = registryKey.GetValue(null) as string; 314 | if (val != null) 315 | { 316 | val += "\\shell\\open\\command"; 317 | using (RegistryKey registryKey2 = Registry.ClassesRoot.OpenSubKey(val)) 318 | { 319 | string val3 = LuaExecutablePathInter(registryKey2); 320 | if (!string.IsNullOrEmpty(val3)) 321 | { 322 | return val3; 323 | } 324 | } 325 | } 326 | } 327 | } 328 | return String.Empty; 329 | } 330 | 331 | private static string LuaExecutablePathInter(RegistryKey registryKey2) 332 | { 333 | if (registryKey2 != null) 334 | { 335 | string val2 = registryKey2.GetValue(null) as string; 336 | if (!string.IsNullOrEmpty(val2)) 337 | { 338 | string val3 = val2; 339 | int pos = val2.IndexOf(" \"", StringComparison.Ordinal); 340 | if (pos != -1) 341 | { 342 | val3 = val2.Substring(0, pos); 343 | } 344 | 345 | val3 = val3.Trim('"'); 346 | return val3; 347 | } 348 | } 349 | 350 | return String.Empty; 351 | } 352 | } 353 | } -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/ScriptAssetOpener.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf95cf64735d1384ca07ef1c6e0a366c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/UnityEditor.Lumin.Extensions.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "UnityEditor.Lumin.Extensions", 3 | "references": [], 4 | "optionalUnityReferences": [], 5 | "includePlatforms": [ 6 | "Editor" 7 | ], 8 | "excludePlatforms": [] 9 | } -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/UnityEditor.Lumin.Extensions.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 275048ac1ac62524986fe017eee3c0f2 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/VisualStudioFileOpenTool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akof1314/Unity-ConsoleTiny/19b024a34ef95310b52f9601ba0a05df19898698/PackagesCustom/com.wuhuan.consoletiny/Editor/VisualStudioFileOpenTool.exe -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/Editor/VisualStudioFileOpenTool.exe.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8383b3f83a76f64fbdae12c53f4010e 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.wuhuan.consoletiny", 3 | "displayName": "Console Tiny", 4 | "version": "1.0.0", 5 | "unity": "2018.4", 6 | "description": "consoletiny.", 7 | "keywords": [ 8 | "consoletiny" 9 | ], 10 | "category": "Editor", 11 | "dependencies": {} 12 | } 13 | -------------------------------------------------------------------------------- /PackagesCustom/com.wuhuan.consoletiny/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4bf34a04dd9a214ea690711845c36de 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /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 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 0 20 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 10 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: 0 23 | m_ReuseCollisionCallbacks: 0 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | -------------------------------------------------------------------------------- /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 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /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: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInPlayMode: 1 24 | -------------------------------------------------------------------------------- /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 | - {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | m_PreloadedShaders: [] 40 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 41 | type: 0} 42 | m_CustomRenderPipeline: {fileID: 0} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 0 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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: 4 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_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 0 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 15 7 | productGUID: 864d040132c35be4499d08a0a03615c3 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: ConsoleTiny 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 1 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 0 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 0 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | resizableWindow: 0 83 | useMacAppStoreValidation: 0 84 | macAppStoreCategory: public.app-category.games 85 | gpuSkinning: 0 86 | graphicsJobs: 0 87 | xboxPIXTextureCapture: 0 88 | xboxEnableAvatar: 0 89 | xboxEnableKinect: 0 90 | xboxEnableKinectAutoTracking: 0 91 | xboxEnableFitness: 0 92 | visibleInBackground: 1 93 | allowFullscreenSwitch: 1 94 | graphicsJobMode: 0 95 | fullscreenMode: 1 96 | xboxSpeechDB: 0 97 | xboxEnableHeadOrientation: 0 98 | xboxEnableGuest: 0 99 | xboxEnablePIXSampling: 0 100 | metalFramebufferOnly: 0 101 | xboxOneResolution: 0 102 | xboxOneSResolution: 0 103 | xboxOneXResolution: 3 104 | xboxOneMonoLoggingLevel: 0 105 | xboxOneLoggingLevel: 1 106 | xboxOneDisableEsram: 0 107 | xboxOnePresentImmediateThreshold: 0 108 | switchQueueCommandMemory: 1048576 109 | switchQueueControlMemory: 16384 110 | switchQueueComputeMemory: 262144 111 | switchNVNShaderPoolsGranularity: 33554432 112 | switchNVNDefaultPoolsGranularity: 16777216 113 | switchNVNOtherPoolsGranularity: 16777216 114 | vulkanEnableSetSRGBWrite: 0 115 | m_SupportedAspectRatios: 116 | 4:3: 1 117 | 5:4: 1 118 | 16:10: 1 119 | 16:9: 1 120 | Others: 1 121 | bundleVersion: 1.0 122 | preloadedAssets: [] 123 | metroInputSource: 0 124 | wsaTransparentSwapchain: 0 125 | m_HolographicPauseOnTrackingLoss: 1 126 | xboxOneDisableKinectGpuReservation: 0 127 | xboxOneEnable7thCore: 1 128 | isWsaHolographicRemotingEnabled: 0 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | oculus: 144 | sharedDepthBuffer: 1 145 | dashSupport: 1 146 | enable360StereoCapture: 0 147 | protectGraphicsMemory: 0 148 | enableFrameTimingStats: 0 149 | useHDRDisplay: 0 150 | m_ColorGamuts: 00000000 151 | targetPixelDensity: 30 152 | resolutionScalingMode: 0 153 | androidSupportedAspectRatio: 1 154 | androidMaxAspectRatio: 2.1 155 | applicationIdentifier: {} 156 | buildNumber: {} 157 | AndroidBundleVersionCode: 1 158 | AndroidMinSdkVersion: 16 159 | AndroidTargetSdkVersion: 0 160 | AndroidPreferredInstallLocation: 1 161 | aotOptions: 162 | stripEngineCode: 1 163 | iPhoneStrippingLevel: 0 164 | iPhoneScriptCallOptimization: 0 165 | ForceInternetPermission: 0 166 | ForceSDCardPermission: 0 167 | CreateWallpaper: 0 168 | APKExpansionFiles: 0 169 | keepLoadedShadersAlive: 0 170 | StripUnusedMeshComponents: 0 171 | VertexChannelCompressionMask: 4054 172 | iPhoneSdkVersion: 988 173 | iOSTargetOSVersionString: 9.0 174 | tvOSSdkVersion: 0 175 | tvOSRequireExtendedGameController: 0 176 | tvOSTargetOSVersionString: 9.0 177 | uIPrerenderedIcon: 0 178 | uIRequiresPersistentWiFi: 0 179 | uIRequiresFullScreen: 1 180 | uIStatusBarHidden: 1 181 | uIExitOnSuspend: 0 182 | uIStatusBarStyle: 0 183 | iPhoneSplashScreen: {fileID: 0} 184 | iPhoneHighResSplashScreen: {fileID: 0} 185 | iPhoneTallHighResSplashScreen: {fileID: 0} 186 | iPhone47inSplashScreen: {fileID: 0} 187 | iPhone55inPortraitSplashScreen: {fileID: 0} 188 | iPhone55inLandscapeSplashScreen: {fileID: 0} 189 | iPhone58inPortraitSplashScreen: {fileID: 0} 190 | iPhone58inLandscapeSplashScreen: {fileID: 0} 191 | iPadPortraitSplashScreen: {fileID: 0} 192 | iPadHighResPortraitSplashScreen: {fileID: 0} 193 | iPadLandscapeSplashScreen: {fileID: 0} 194 | iPadHighResLandscapeSplashScreen: {fileID: 0} 195 | appleTVSplashScreen: {fileID: 0} 196 | appleTVSplashScreen2x: {fileID: 0} 197 | tvOSSmallIconLayers: [] 198 | tvOSSmallIconLayers2x: [] 199 | tvOSLargeIconLayers: [] 200 | tvOSLargeIconLayers2x: [] 201 | tvOSTopShelfImageLayers: [] 202 | tvOSTopShelfImageLayers2x: [] 203 | tvOSTopShelfImageWideLayers: [] 204 | tvOSTopShelfImageWideLayers2x: [] 205 | iOSLaunchScreenType: 0 206 | iOSLaunchScreenPortrait: {fileID: 0} 207 | iOSLaunchScreenLandscape: {fileID: 0} 208 | iOSLaunchScreenBackgroundColor: 209 | serializedVersion: 2 210 | rgba: 0 211 | iOSLaunchScreenFillPct: 100 212 | iOSLaunchScreenSize: 100 213 | iOSLaunchScreenCustomXibPath: 214 | iOSLaunchScreeniPadType: 0 215 | iOSLaunchScreeniPadImage: {fileID: 0} 216 | iOSLaunchScreeniPadBackgroundColor: 217 | serializedVersion: 2 218 | rgba: 0 219 | iOSLaunchScreeniPadFillPct: 100 220 | iOSLaunchScreeniPadSize: 100 221 | iOSLaunchScreeniPadCustomXibPath: 222 | iOSUseLaunchScreenStoryboard: 0 223 | iOSLaunchScreenCustomStoryboardPath: 224 | iOSDeviceRequirements: [] 225 | iOSURLSchemes: [] 226 | iOSBackgroundModes: 0 227 | iOSMetalForceHardShadows: 0 228 | metalEditorSupport: 1 229 | metalAPIValidation: 1 230 | iOSRenderExtraFrameOnPause: 0 231 | appleDeveloperTeamID: 232 | iOSManualSigningProvisioningProfileID: 233 | tvOSManualSigningProvisioningProfileID: 234 | iOSManualSigningProvisioningProfileType: 0 235 | tvOSManualSigningProvisioningProfileType: 0 236 | appleEnableAutomaticSigning: 0 237 | iOSRequireARKit: 0 238 | iOSAutomaticallyDetectAndAddCapabilities: 1 239 | appleEnableProMotion: 0 240 | clonedFromGUID: 00000000000000000000000000000000 241 | templatePackageId: 242 | templateDefaultScene: 243 | AndroidTargetArchitectures: 1 244 | AndroidSplashScreenScale: 0 245 | androidSplashScreen: {fileID: 0} 246 | AndroidKeystoreName: 247 | AndroidKeyaliasName: 248 | AndroidBuildApkPerCpuArchitecture: 0 249 | AndroidTVCompatibility: 0 250 | AndroidIsGame: 1 251 | AndroidEnableTango: 0 252 | androidEnableBanner: 1 253 | androidUseLowAccuracyLocation: 0 254 | m_AndroidBanners: 255 | - width: 320 256 | height: 180 257 | banner: {fileID: 0} 258 | androidGamepadSupportLevel: 0 259 | resolutionDialogBanner: {fileID: 0} 260 | m_BuildTargetIcons: [] 261 | m_BuildTargetPlatformIcons: [] 262 | m_BuildTargetBatching: [] 263 | m_BuildTargetGraphicsAPIs: [] 264 | m_BuildTargetVRSettings: [] 265 | m_BuildTargetEnableVuforiaSettings: [] 266 | openGLRequireES31: 0 267 | openGLRequireES31AEP: 0 268 | m_TemplateCustomTags: {} 269 | mobileMTRendering: 270 | Android: 1 271 | iPhone: 1 272 | tvOS: 1 273 | m_BuildTargetGroupLightmapEncodingQuality: [] 274 | m_BuildTargetGroupLightmapSettings: [] 275 | playModeTestRunnerEnabled: 0 276 | runPlayModeTestAsEditModeTest: 0 277 | actionOnDotNetUnhandledException: 1 278 | enableInternalProfiler: 0 279 | logObjCUncaughtExceptions: 1 280 | enableCrashReportAPI: 0 281 | cameraUsageDescription: 282 | locationUsageDescription: 283 | microphoneUsageDescription: 284 | switchNetLibKey: 285 | switchSocketMemoryPoolSize: 6144 286 | switchSocketAllocatorPoolSize: 128 287 | switchSocketConcurrencyLimit: 14 288 | switchScreenResolutionBehavior: 2 289 | switchUseCPUProfiler: 0 290 | switchApplicationID: 0x01004b9000490000 291 | switchNSODependencies: 292 | switchTitleNames_0: 293 | switchTitleNames_1: 294 | switchTitleNames_2: 295 | switchTitleNames_3: 296 | switchTitleNames_4: 297 | switchTitleNames_5: 298 | switchTitleNames_6: 299 | switchTitleNames_7: 300 | switchTitleNames_8: 301 | switchTitleNames_9: 302 | switchTitleNames_10: 303 | switchTitleNames_11: 304 | switchTitleNames_12: 305 | switchTitleNames_13: 306 | switchTitleNames_14: 307 | switchPublisherNames_0: 308 | switchPublisherNames_1: 309 | switchPublisherNames_2: 310 | switchPublisherNames_3: 311 | switchPublisherNames_4: 312 | switchPublisherNames_5: 313 | switchPublisherNames_6: 314 | switchPublisherNames_7: 315 | switchPublisherNames_8: 316 | switchPublisherNames_9: 317 | switchPublisherNames_10: 318 | switchPublisherNames_11: 319 | switchPublisherNames_12: 320 | switchPublisherNames_13: 321 | switchPublisherNames_14: 322 | switchIcons_0: {fileID: 0} 323 | switchIcons_1: {fileID: 0} 324 | switchIcons_2: {fileID: 0} 325 | switchIcons_3: {fileID: 0} 326 | switchIcons_4: {fileID: 0} 327 | switchIcons_5: {fileID: 0} 328 | switchIcons_6: {fileID: 0} 329 | switchIcons_7: {fileID: 0} 330 | switchIcons_8: {fileID: 0} 331 | switchIcons_9: {fileID: 0} 332 | switchIcons_10: {fileID: 0} 333 | switchIcons_11: {fileID: 0} 334 | switchIcons_12: {fileID: 0} 335 | switchIcons_13: {fileID: 0} 336 | switchIcons_14: {fileID: 0} 337 | switchSmallIcons_0: {fileID: 0} 338 | switchSmallIcons_1: {fileID: 0} 339 | switchSmallIcons_2: {fileID: 0} 340 | switchSmallIcons_3: {fileID: 0} 341 | switchSmallIcons_4: {fileID: 0} 342 | switchSmallIcons_5: {fileID: 0} 343 | switchSmallIcons_6: {fileID: 0} 344 | switchSmallIcons_7: {fileID: 0} 345 | switchSmallIcons_8: {fileID: 0} 346 | switchSmallIcons_9: {fileID: 0} 347 | switchSmallIcons_10: {fileID: 0} 348 | switchSmallIcons_11: {fileID: 0} 349 | switchSmallIcons_12: {fileID: 0} 350 | switchSmallIcons_13: {fileID: 0} 351 | switchSmallIcons_14: {fileID: 0} 352 | switchManualHTML: 353 | switchAccessibleURLs: 354 | switchLegalInformation: 355 | switchMainThreadStackSize: 1048576 356 | switchPresenceGroupId: 357 | switchLogoHandling: 0 358 | switchReleaseVersion: 0 359 | switchDisplayVersion: 1.0.0 360 | switchStartupUserAccount: 0 361 | switchTouchScreenUsage: 0 362 | switchSupportedLanguagesMask: 0 363 | switchLogoType: 0 364 | switchApplicationErrorCodeCategory: 365 | switchUserAccountSaveDataSize: 0 366 | switchUserAccountSaveDataJournalSize: 0 367 | switchApplicationAttribute: 0 368 | switchCardSpecSize: -1 369 | switchCardSpecClock: -1 370 | switchRatingsMask: 0 371 | switchRatingsInt_0: 0 372 | switchRatingsInt_1: 0 373 | switchRatingsInt_2: 0 374 | switchRatingsInt_3: 0 375 | switchRatingsInt_4: 0 376 | switchRatingsInt_5: 0 377 | switchRatingsInt_6: 0 378 | switchRatingsInt_7: 0 379 | switchRatingsInt_8: 0 380 | switchRatingsInt_9: 0 381 | switchRatingsInt_10: 0 382 | switchRatingsInt_11: 0 383 | switchLocalCommunicationIds_0: 384 | switchLocalCommunicationIds_1: 385 | switchLocalCommunicationIds_2: 386 | switchLocalCommunicationIds_3: 387 | switchLocalCommunicationIds_4: 388 | switchLocalCommunicationIds_5: 389 | switchLocalCommunicationIds_6: 390 | switchLocalCommunicationIds_7: 391 | switchParentalControl: 0 392 | switchAllowsScreenshot: 1 393 | switchAllowsVideoCapturing: 1 394 | switchAllowsRuntimeAddOnContentInstall: 0 395 | switchDataLossConfirmation: 0 396 | switchUserAccountLockEnabled: 0 397 | switchSystemResourceMemory: 16777216 398 | switchSupportedNpadStyles: 6 399 | switchNativeFsCacheSize: 32 400 | switchIsHoldTypeHorizontal: 0 401 | switchSupportedNpadCount: 8 402 | switchSocketConfigEnabled: 0 403 | switchTcpInitialSendBufferSize: 32 404 | switchTcpInitialReceiveBufferSize: 64 405 | switchTcpAutoSendBufferSizeMax: 256 406 | switchTcpAutoReceiveBufferSizeMax: 256 407 | switchUdpSendBufferSize: 9 408 | switchUdpReceiveBufferSize: 42 409 | switchSocketBufferEfficiency: 4 410 | switchSocketInitializeEnabled: 1 411 | switchNetworkInterfaceManagerInitializeEnabled: 1 412 | switchPlayerConnectionEnabled: 1 413 | ps4NPAgeRating: 12 414 | ps4NPTitleSecret: 415 | ps4NPTrophyPackPath: 416 | ps4ParentalLevel: 11 417 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 418 | ps4Category: 0 419 | ps4MasterVersion: 01.00 420 | ps4AppVersion: 01.00 421 | ps4AppType: 0 422 | ps4ParamSfxPath: 423 | ps4VideoOutPixelFormat: 0 424 | ps4VideoOutInitialWidth: 1920 425 | ps4VideoOutBaseModeInitialWidth: 1920 426 | ps4VideoOutReprojectionRate: 60 427 | ps4PronunciationXMLPath: 428 | ps4PronunciationSIGPath: 429 | ps4BackgroundImagePath: 430 | ps4StartupImagePath: 431 | ps4StartupImagesFolder: 432 | ps4IconImagesFolder: 433 | ps4SaveDataImagePath: 434 | ps4SdkOverride: 435 | ps4BGMPath: 436 | ps4ShareFilePath: 437 | ps4ShareOverlayImagePath: 438 | ps4PrivacyGuardImagePath: 439 | ps4NPtitleDatPath: 440 | ps4RemotePlayKeyAssignment: -1 441 | ps4RemotePlayKeyMappingDir: 442 | ps4PlayTogetherPlayerCount: 0 443 | ps4EnterButtonAssignment: 2 444 | ps4ApplicationParam1: 0 445 | ps4ApplicationParam2: 0 446 | ps4ApplicationParam3: 0 447 | ps4ApplicationParam4: 0 448 | ps4DownloadDataSize: 0 449 | ps4GarlicHeapSize: 2048 450 | ps4ProGarlicHeapSize: 2560 451 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 452 | ps4pnSessions: 1 453 | ps4pnPresence: 1 454 | ps4pnFriends: 1 455 | ps4pnGameCustomData: 1 456 | playerPrefsSupport: 0 457 | enableApplicationExit: 0 458 | resetTempFolder: 1 459 | restrictedAudioUsageRights: 0 460 | ps4UseResolutionFallback: 0 461 | ps4ReprojectionSupport: 0 462 | ps4UseAudio3dBackend: 0 463 | ps4SocialScreenEnabled: 0 464 | ps4ScriptOptimizationLevel: 2 465 | ps4Audio3dVirtualSpeakerCount: 14 466 | ps4attribCpuUsage: 0 467 | ps4PatchPkgPath: 468 | ps4PatchLatestPkgPath: 469 | ps4PatchChangeinfoPath: 470 | ps4PatchDayOne: 0 471 | ps4attribUserManagement: 0 472 | ps4attribMoveSupport: 0 473 | ps4attrib3DSupport: 0 474 | ps4attribShareSupport: 0 475 | ps4attribExclusiveVR: 0 476 | ps4disableAutoHideSplash: 0 477 | ps4videoRecordingFeaturesUsed: 0 478 | ps4contentSearchFeaturesUsed: 0 479 | ps4attribEyeToEyeDistanceSettingVR: 0 480 | ps4IncludedModules: [] 481 | monoEnv: 482 | splashScreenBackgroundSourceLandscape: {fileID: 0} 483 | splashScreenBackgroundSourcePortrait: {fileID: 0} 484 | spritePackerPolicy: 485 | webGLMemorySize: 256 486 | webGLExceptionSupport: 1 487 | webGLNameFilesAsHashes: 0 488 | webGLDataCaching: 1 489 | webGLDebugSymbols: 0 490 | webGLEmscriptenArgs: 491 | webGLModulesDirectory: 492 | webGLTemplate: APPLICATION:Default 493 | webGLAnalyzeBuildSize: 0 494 | webGLUseEmbeddedResources: 0 495 | webGLCompressionFormat: 1 496 | webGLLinkerTarget: 1 497 | webGLThreadsSupport: 0 498 | scriptingDefineSymbols: {} 499 | platformArchitecture: {} 500 | scriptingBackend: {} 501 | il2cppCompilerConfiguration: {} 502 | managedStrippingLevel: {} 503 | incrementalIl2cppBuild: {} 504 | allowUnsafeCode: 0 505 | additionalIl2CppArgs: 506 | scriptingRuntimeVersion: 1 507 | apiCompatibilityLevelPerPlatform: {} 508 | m_RenderingPath: 1 509 | m_MobileRenderingPath: 1 510 | metroPackageName: ConsoleTiny 511 | metroPackageVersion: 512 | metroCertificatePath: 513 | metroCertificatePassword: 514 | metroCertificateSubject: 515 | metroCertificateIssuer: 516 | metroCertificateNotAfter: 0000000000000000 517 | metroApplicationDescription: ConsoleTiny 518 | wsaImages: {} 519 | metroTileShortName: 520 | metroTileShowName: 0 521 | metroMediumTileShowName: 0 522 | metroLargeTileShowName: 0 523 | metroWideTileShowName: 0 524 | metroSupportStreamingInstall: 0 525 | metroLastRequiredScene: 0 526 | metroDefaultTileSize: 1 527 | metroTileForegroundText: 2 528 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 529 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 530 | a: 1} 531 | metroSplashScreenUseBackgroundColor: 0 532 | platformCapabilities: {} 533 | metroTargetDeviceFamilies: {} 534 | metroFTAName: 535 | metroFTAFileTypes: [] 536 | metroProtocolName: 537 | metroCompilationOverrides: 1 538 | XboxOneProductId: 539 | XboxOneUpdateKey: 540 | XboxOneSandboxId: 541 | XboxOneContentId: 542 | XboxOneTitleId: 543 | XboxOneSCId: 544 | XboxOneGameOsOverridePath: 545 | XboxOnePackagingOverridePath: 546 | XboxOneAppManifestOverridePath: 547 | XboxOneVersion: 1.0.0.0 548 | XboxOnePackageEncryption: 0 549 | XboxOnePackageUpdateGranularity: 2 550 | XboxOneDescription: 551 | XboxOneLanguage: 552 | - enus 553 | XboxOneCapability: [] 554 | XboxOneGameRating: {} 555 | XboxOneIsContentPackage: 0 556 | XboxOneEnableGPUVariability: 1 557 | XboxOneSockets: {} 558 | XboxOneSplashScreen: {fileID: 0} 559 | XboxOneAllowedProductIds: [] 560 | XboxOnePersistentLocalStorageSize: 0 561 | XboxOneXTitleMemory: 8 562 | xboxOneScriptCompiler: 0 563 | XboxOneOverrideIdentityName: 564 | vrEditorSettings: 565 | daydream: 566 | daydreamIconForeground: {fileID: 0} 567 | daydreamIconBackground: {fileID: 0} 568 | cloudServicesEnabled: {} 569 | luminIcon: 570 | m_Name: 571 | m_ModelFolderPath: 572 | m_PortalFolderPath: 573 | luminCert: 574 | m_CertPath: 575 | m_PrivateKeyPath: 576 | luminIsChannelApp: 0 577 | luminVersion: 578 | m_VersionCode: 1 579 | m_VersionName: 580 | facebookSdkVersion: 581 | facebookAppId: 582 | facebookCookies: 1 583 | facebookLogging: 1 584 | facebookStatus: 1 585 | facebookXfbml: 0 586 | facebookFrictionlessRequests: 1 587 | apiCompatibilityLevel: 6 588 | cloudProjectId: 589 | framebufferDepthMemorylessMode: 0 590 | projectName: 591 | organizationId: 592 | cloudEnabled: 0 593 | enableNativePlatformBackendsForNewInputSystem: 0 594 | disableOldInputManagerSupport: 0 595 | legacyClampBlendShapeWeights: 0 596 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.4.6f1 2 | -------------------------------------------------------------------------------- /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: 5 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 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 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: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo Switch: 5 223 | PS4: 5 224 | Standalone: 5 225 | WebGL: 3 226 | Windows Store Apps: 5 227 | XboxOne: 5 228 | iPhone: 2 229 | tvOS: 2 230 | -------------------------------------------------------------------------------- /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 | - 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/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.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /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 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 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/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-ConsoleTiny 2 | Console Tiny is a powerful replacement for Unity's editor console. 3 | 4 | ## Feature 5 | - Text Search Filter 6 | - Multi-line Display 7 | - Colored Callstacks 8 | - Callstack Navigation 9 | - Custom Filters 10 | - DLL Support 11 | - Lua Support 12 | - Wrapper Support 13 | 14 | ![](https://github.com/akof1314/Unity-ConsoleTiny/raw/master/DLLTest/screenshot.png) 15 | 16 | ## Install 17 | - Unity 5.x 18 | - [Unity-ConsoleTiny_5X.unitypackage](https://github.com/akof1314/Unity-ConsoleTiny/releases) 19 | - Unity 2017.x 20 | - `UnityPackageManager\manifest.json` 21 | - Unity 2018.x (or later) 22 | - `Packages\manifest.json` 23 | 24 | `manifest.json` file add line: 25 | 26 | ``` 27 | "com.wuhuan.consoletiny": "file:../PackagesCustom/com.wuhuan.consoletiny" 28 | 29 | ``` 30 | 31 | ## Usage 32 | Open window: `Ctrl+Shift+T` (Linux/Windows) or `Cmd+Shift+T` (OS X). 33 | 34 | ## License 35 | MIT --------------------------------------------------------------------------------