Skip to content

Instantly share code, notes, and snippets.

@s2kw
Created February 12, 2013 00:21
Show Gist options
  • Save s2kw/4758921 to your computer and use it in GitHub Desktop.
Save s2kw/4758921 to your computer and use it in GitHub Desktop.
UnityEditor.ScriptableWizard test
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