public static void Init() { selectedObject = Selection.activeObject; if (selectedObject == null) { return; } CreateAnimations window = (CreateAnimations)EditorWindow.GetWindow(typeof(CreateAnimations)); window.Show(); }
static void Init() { //Grab the active object selectedObject = Selection.activeObject; //If the object doesn't exist, do nothing if (selectedObject == null) { return; } //Otherwise, create a new window CreateAnimations window = (CreateAnimations)EditorWindow.GetWindow(typeof(CreateAnimations)); //Show the window window.Show(); }
public void OnGUI() { GUILayout.Label("Frame Rate"); frameRateStr = GUILayout.TextField(frameRateStr); var go = GUILayout.Button("Go"); if (go) { int frameRate; if (!int.TryParse(frameRateStr, out frameRate)) { frameRate = 1; } // Undo.RegisterCompleteObjectUndo(c, "Create Animations"); CreateAnimations.CreatePlayerIdle(); CreateAnimations.CreatePlayerSwordAttack1(); } }