├── KKTools
├── KKTools Guide.pdf
└── Editor
│ ├── AssetBundle
│ ├── AssetBundleOther.cs
│ ├── AssetBundleBuild.cs
│ ├── AssetBundleWatch.cs
│ └── AssetBundleAnalyzer.cs
│ ├── Static
│ ├── ShowIconInHierarchy.cs
│ ├── ShowSortingOrder.cs
│ └── TransformInspectorResetEditor.cs
│ ├── Window
│ └── SceneWatcher.cs
│ ├── KKToolsManager.cs
│ ├── UtilityEditor.cs
│ ├── Create
│ └── MakeFolders.cs
│ ├── Prefab
│ └── PrefabTool.cs
│ ├── UGUI
│ └── UGUITool.cs
│ └── Finder
│ └── GameObjectFinder.cs
├── .gitignore
├── README.md
└── LICENCE
/KKTools/KKTools Guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/k79k06k02k/KKTools/HEAD/KKTools/KKTools Guide.pdf
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # =============== #
2 | # Unity generated #
3 | # =============== #
4 | Temp/
5 | Library/
6 |
7 | # ===================================== #
8 | # Visual Studio / MonoDevelop generated #
9 | # ===================================== #
10 | ExportedObj/
11 | obj/
12 | *.svd
13 | *.userprefs
14 | *.csproj
15 | *.pidb
16 | *.suo
17 | *.sln
18 | *.user
19 | *.unityproj
20 | *.booproj
21 |
22 | # ============ #
23 | # OS generated #
24 | # ============ #
25 | .DS_Store
26 | .DS_Store?
27 | ._*
28 | .Spotlight-V100
29 | .Trashes
30 | ehthumbs.db
31 | Thumbs.db
32 |
33 | *.meta
34 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # KKTools
2 | [Guide](https://github.com/k79k06k02k/KKTools/blob/master/KKTools/KKTools%20Guide.pdf)
3 |
4 | ## Support & Feedback
5 | Blog:[http://k79k06k02k.com/blog](http://k79k06k02k.com/blog)
6 | Facebook:[https://www.facebook.com/k79k06k02k](https://www.facebook.com/k79k06k02k)
7 | Email:k79k06k02k@gmail.com
8 |
9 | Something code are quote from [AssetBundleAnalyzer](http://forum.unity3d.com/threads/asset-bundle-analyzer.182413/)、[GameObjectFinder](http://wiki.unity3d.com/index.php/FindGameObjects)、[SceneWatcher](http://wiki.unity3d.com/index.php/SceneViewWindow) The license of the that follow theirs.
10 |
--------------------------------------------------------------------------------
/KKTools/Editor/AssetBundle/AssetBundleOther.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : AssetBundleOther.cs
4 | **********************************************************/
5 | using UnityEngine;
6 | using UnityEditor;
7 | using System.Text;
8 |
9 | public class AssetBundleOther : AssetPostprocessor
10 | {
11 | public static void ShowAllAssetBundleNames()
12 | {
13 | StringBuilder sb = new StringBuilder();
14 | string[] assetBundleNames = AssetDatabase.GetAllAssetBundleNames();
15 |
16 | foreach (string str in assetBundleNames)
17 | sb.Append(str + "\n");
18 |
19 | Debug.Log("AssetBundleNames:\n" + sb.ToString());
20 | }
21 |
22 | void OnPostprocessAssetbundleNameChanged(string path, string previous, string next)
23 | {
24 | Debug.Log("AB: " + path + "\told: " + previous + "\tnew: " + next);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/LICENCE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Arkai
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 |
--------------------------------------------------------------------------------
/KKTools/Editor/Static/ShowIconInHierarchy.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : ShowIconInHierarchy.cs
4 | **********************************************************/
5 | using UnityEngine;
6 | using System.Collections;
7 | using System.Reflection;
8 | using UnityEditor;
9 |
10 | public class ShowIconInHierarchy {
11 |
12 | private const int WIDTH = 16;
13 |
14 | private static readonly MethodInfo mGetIconForObject = typeof(EditorGUIUtility)
15 | .GetMethod("GetIconForObject", BindingFlags.NonPublic | BindingFlags.Static);
16 |
17 | [InitializeOnLoadMethod]
18 | private static void Example()
19 | {
20 | EditorApplication.hierarchyWindowItemOnGUI += OnGUI;
21 | }
22 |
23 | private static void OnGUI(int instanceID, Rect selectionRect)
24 | {
25 | var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
26 |
27 | if (go == null)
28 | {
29 | return;
30 | }
31 |
32 | var parameters = new object[] { go };
33 | var icon = mGetIconForObject.Invoke(null, parameters) as Texture;
34 |
35 | if (icon == null)
36 | {
37 | return;
38 | }
39 |
40 | var pos = selectionRect;
41 | pos.x = pos.xMax - WIDTH;
42 | pos.width = WIDTH;
43 |
44 | GUI.DrawTexture(pos, icon, ScaleMode.ScaleToFit, true);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/KKTools/Editor/Window/SceneWatcher.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : SceneWatcher.cs
4 | // Reference: http://wiki.unity3d.com/index.php/SceneViewWindow
5 | **********************************************************/
6 |
7 | using System.IO;
8 | using UnityEditor;
9 | using UnityEngine;
10 |
11 | public class SceneWatcher : EditorWindow
12 | {
13 |
14 | private Vector2 scrollPos;
15 |
16 |
17 | public static void Init()
18 | {
19 | var window = (SceneWatcher)GetWindow(typeof(SceneWatcher), false, "Scene Watcher");
20 | window.position = new Rect(window.position.xMin + 100f, window.position.yMin + 100f, 400f, 400f);
21 | }
22 |
23 |
24 | void OnGUI()
25 | {
26 | EditorGUILayout.BeginVertical();
27 | this.scrollPos = EditorGUILayout.BeginScrollView(this.scrollPos, false, false);
28 |
29 | GUILayout.Label("Scenes In Build", EditorStyles.boldLabel);
30 | for (var i = 0; i < EditorBuildSettings.scenes.Length; i++)
31 | {
32 | var scene = EditorBuildSettings.scenes[i];
33 | if (scene.enabled)
34 | {
35 | var sceneName = Path.GetFileNameWithoutExtension(scene.path);
36 | var pressed = GUILayout.Button(i + ": " + sceneName, new GUIStyle(GUI.skin.GetStyle("Button")) { alignment = TextAnchor.MiddleLeft });
37 | if (pressed)
38 | {
39 | if (EditorApplication.SaveCurrentSceneIfUserWantsTo())
40 | {
41 | EditorApplication.OpenScene(scene.path);
42 | }
43 | }
44 | }
45 | }
46 |
47 | EditorGUILayout.EndScrollView();
48 | EditorGUILayout.EndVertical();
49 | }
50 | }
--------------------------------------------------------------------------------
/KKTools/Editor/KKToolsManager.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : KKToolsManager.cs
4 | **********************************************************/
5 | using UnityEditor;
6 |
7 | public class KKToolsManager
8 | {
9 | //=======================================================================================
10 | //AssetBundle
11 | [MenuItem("KKTools/AssetBundle/AssetBundle Analyze")]
12 | static void AssetBundle_Analyze()
13 | {
14 | AssetBundleAnalyzer.ShowWindow();
15 | }
16 |
17 | [MenuItem("KKTools/AssetBundle/AssetBundle Watch")]
18 | static void AssetBundle_Watch()
19 | {
20 | AssetBundleWatch.ShowWindow();
21 | }
22 |
23 | [MenuItem("KKTools/AssetBundle/AssetBundle Build")]
24 | static void AssetBundle_Build()
25 | {
26 | AssetBundleBuild.ShowWindow();
27 | }
28 |
29 | [MenuItem("KKTools/AssetBundle/AssetBundle Build All Platform")]
30 | static void AssetBundle_BuildAllPlatform()
31 | {
32 | AssetBundleBuild.BuildAllPlatform();
33 | }
34 |
35 | [MenuItem("KKTools/AssetBundle/AssetBundle Show All Name")]
36 | static void AssetBundle_ShowAllNames()
37 | {
38 | AssetBundleOther.ShowAllAssetBundleNames();
39 | }
40 |
41 |
42 | //=======================================================================================
43 | //Create
44 | [MenuItem("KKTools/Create/Make Project Folders")]
45 | static void Create_MakeFolders()
46 | {
47 | MakeFolders.ShowWindow();
48 | }
49 |
50 |
51 | //=======================================================================================
52 | //Finder
53 | [MenuItem("KKTools/Finder/Finder")]
54 | static void Finder_GameObjectFinder()
55 | {
56 | GameObjectFinder.ShowWindow();
57 | }
58 |
59 |
60 | //=======================================================================================
61 | //Prefab
62 | [MenuItem("KKTools/Prefab/Prefab Tool")]
63 | static void Prefab_PrefabTool()
64 | {
65 | PrefabTool.ShowView();
66 | }
67 |
68 |
69 | //=======================================================================================
70 | //UGUI
71 | [MenuItem("KKTools/UGUI/UGUI Tool")]
72 | static void UGUI_UGUITool()
73 | {
74 | UGUITool.ShowWindow();
75 | }
76 |
77 |
78 | //=======================================================================================
79 | //Window
80 | [MenuItem("KKTools/Window/Scene Watcher")]
81 | static void Window_SceneWatcher()
82 | {
83 | SceneWatcher.Init();
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/KKTools/Editor/UtilityEditor.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : UtilityEditor.cs
4 | **********************************************************/
5 | using UnityEngine;
6 | using UnityEditor;
7 |
8 | public class UtilityEditor
9 | {
10 | public static bool GetCommonButton(string btnName)
11 | {
12 | GUIStyle BtnStyle = new GUIStyle(GUI.skin.button);
13 | BtnStyle.fontSize = 25;
14 | BtnStyle.fixedHeight = 50;
15 |
16 | return GUILayout.Button(btnName, BtnStyle);
17 | }
18 |
19 |
20 | ///
21 | /// Create Folder(path not include "Assets")
22 | /// EX: GameResources/Prefabs/Sprites/Enemy
23 | ///
24 | public static void CreateFolder(string name)
25 | {
26 | string[] splitName = name.Split('/');
27 |
28 | string prefixFolderName = "";
29 | string pathValid = "";
30 | for (int i = 0; i < splitName.Length; i++)
31 | {
32 | pathValid += "/" + splitName[i];
33 |
34 | if (AssetDatabase.IsValidFolder("Assets" + pathValid) == false)
35 | AssetDatabase.CreateFolder("Assets" + prefixFolderName, splitName[i]);
36 |
37 | prefixFolderName += "/" + splitName[i];
38 | }
39 | }
40 |
41 | public static int Tabs(string[] options, int selected)
42 | {
43 | const float DarkGray = 0.6f;
44 | const float LightGray = 0.9f;
45 | const float StartSpace = 10;
46 |
47 | GUILayout.Space(StartSpace);
48 | Color storeColor = GUI.backgroundColor;
49 | Color highlightCol = new Color(LightGray, LightGray, LightGray);
50 | Color bgCol = new Color(DarkGray, DarkGray, DarkGray);
51 |
52 | GUIStyle buttonStyle = new GUIStyle(GUI.skin.button);
53 | buttonStyle.padding.bottom = 8;
54 |
55 | GUILayout.BeginHorizontal();
56 | {
57 | for (int i = 0; i < options.Length; ++i)
58 | {
59 | GUI.backgroundColor = i == selected ? highlightCol : bgCol;
60 | if (GUILayout.Button(options[i], buttonStyle))
61 | {
62 | selected = i;
63 | }
64 | }
65 | }
66 | GUILayout.EndHorizontal();
67 |
68 | GUI.backgroundColor = storeColor;
69 |
70 | var texture = new Texture2D(1, 1);
71 | texture.SetPixel(0, 0, highlightCol);
72 | texture.Apply();
73 | GUI.DrawTexture(new Rect(0, buttonStyle.lineHeight + buttonStyle.border.top + buttonStyle.margin.top + StartSpace, Screen.width, 4), texture);
74 |
75 | return selected;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/KKTools/Editor/Static/ShowSortingOrder.cs:
--------------------------------------------------------------------------------
1 | /**********************************************************
2 | // Author : K.(k79k06k02k)
3 | // FileName : ShowSortingOrder.cs
4 | **********************************************************/
5 | using UnityEngine;
6 | using UnityEditor;
7 |
8 | public class ShowSortingOrder
9 | {
10 | private const int _LableWidth = 20;
11 | private const int _BtnWidth = 45;
12 | private const string _LablePlus = "+";
13 | private const string _LableLess = "-";
14 |
15 |
16 | [InitializeOnLoadMethod]
17 | private static void Init()
18 | {
19 | EditorApplication.hierarchyWindowItemOnGUI += OnGUI;
20 | }
21 |
22 | private static void OnGUI(int instanceID, Rect selectionRect)
23 | {
24 | var go = EditorUtility.InstanceIDToObject(instanceID) as GameObject;
25 |
26 | if (go == null)
27 | {
28 | return;
29 | }
30 |
31 | Component objSpriteRenderer = go.GetComponent();
32 | Component objCanvas = go.GetComponent