ScriptableWizard.DisplayWizardstatic function DisplayWizard.<T> (title : String) : TParameters
ReturnsT - The wizard. DescriptionCreates a wizard. When the user hits the Create button OnWizardCreate function will be called. DisplayWizard will only show one wizard for every wizard class.
// C# // Simple Wizard that clones an object. using UnityEngine; using UnityEditor; using System.Collections; public class ScriptableWizardDisplayWizard : ScriptableWizard { public GameObject ObjectToCopy = null; public int numberOfCopies = 2; [MenuItem ("Example/Show DisplayWizard usage")] static void CreateWindow() { // Creates the wizard for display ScriptableWizard.DisplayWizard("Copy an object.", typeof(ScriptableWizardDisplayWizard), "Copy!"); } void OnWizardUpdate() { helpString = "Clones an object a number of times"; if(!ObjectToCopy) { errorString = "Please assign an object"; isValid = false; } else { errorString = ""; isValid = true; } } void OnWizardCreate () { for(int i = 0; i < numberOfCopies; i++) Instantiate(ObjectToCopy, Vector3.zero, Quaternion.identity); } }
static function DisplayWizard.<T> (title : String, createButtonName : String, otherButtonName : String) : Tstatic function DisplayWizard (title : String, klass : System.Type, createButtonName : String = "Create", otherButtonName : String = "") : ScriptableWizardParameters
ReturnsScriptableWizard - The wizard. DescriptionCreates a wizard. When the user hits the Create button OnWizardCreate function will be called. DisplayWizard will only show one wizard for every wizard class.
|

