Created
February 12, 2013 00:21
-
-
Save s2kw/4758921 to your computer and use it in GitHub Desktop.
UnityEditor.ScriptableWizard test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class TestWizard : ScriptableWizard { | |
public string gstring; | |
public int gint; | |
private string pstring; | |
private int pint; | |
[UnityEditor.MenuItem("Custom/OHGAKI/TestWizard")] | |
static void WillAppear() | |
{ | |
ScriptableWizard.DisplayWizard("Test Wizard Title in DisplayWizard method.",typeof(TestWizard),"createButtonName","otherButtonName"); | |
} | |
void OnWizardCreate() | |
{ | |
GameObject newGameObj = new GameObject("new GameObj"); | |
newGameObj.AddComponent("SphereCollider"); | |
newGameObj.AddComponent("MeshFilter"); | |
newGameObj.AddComponent("MeshRenderer"); | |
} | |
void OnWizardOtherButton() | |
{ | |
Debug.Log("otherButtonName clicked"); | |
} | |
void OnWizardUpdate() | |
{ | |
helpString = "type \"abc\" in gstring."; | |
if(gstring == "abc"){ | |
isValid = true; | |
errorString = ""; | |
}else{ | |
isValid = false; | |
errorString = "gstring is not \"abc\"."; | |
} | |
position = new Rect(200f,200f,300f,300f); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment