// OnInspector GUI public override void OnInspectorGUI() { // Call base class method base.OnInspectorGUI(); GUILayout.Space(20f); GUILayout.Label("Button Tools", EditorStyles.boldLabel); //Load Prefabs Automatically GUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Auto Get Prefabs", "Automatically load all towers & enemies prefabs."))) { eTools = GameObject.Find("GameEditor").GetComponent <EditorTools>(); eTools.AutoGetPrefabs(); } GUILayout.EndHorizontal(); EditorTools edTools = (EditorTools)target; //Stats Reset buttons GUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Reset Tower Stats", "Apply the default stats to tower units"))) { eTools = GameObject.Find("GameEditor").GetComponent <EditorTools>(); } GUILayout.EndHorizontal(); // Custom Buttons with Image as Thumbnail // Tower Buttons GUILayout.Label("Spawn Tower"); GUILayout.BeginHorizontal(); CreateButton(ref edTools, "Prefabs/Tower01", "Tower01"); }