Skip to content

Commit ea672d5

Browse files
authored
Create 81a-C# Editor Script-NewEditorScript.cs.txt
1 parent 5e3ee3d commit ea672d5

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using UnityEditor;
2+
using UnityEngine;
3+
using System.Collections;
4+
using System.Collections.Generic;
5+
6+
// Custom Editor Script Template
7+
// Place this file into \Unity\Editor\Data\Resources\ScriptTemplates\ - folder
8+
// Then you can right click over Project window and select Create/C# Editor Script
9+
// "81a" in the filename is the menu position
10+
11+
public class #SCRIPTNAME# : EditorWindow
12+
{
13+
[MenuItem("Window/#SCRIPTNAME#")]
14+
static void Init()
15+
{
16+
var window = (#SCRIPTNAME#)EditorWindow.GetWindow(typeof(#SCRIPTNAME#));
17+
window.Show();
18+
}
19+
20+
void OnGUI()
21+
{
22+
//TODO: Add other fields
23+
24+
if (GUILayout.Button("My Button"))
25+
{
26+
DoSomething();
27+
}
28+
}
29+
30+
void DoSomething()
31+
{
32+
Debug.Log("Do Something!");
33+
}
34+
}

0 commit comments

Comments
 (0)