Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ScriptableWizard.DisplayWizard

static function DisplayWizard(title: string): T;
static T DisplayWizard(string title);
static def DisplayWizard(title as string) as T

Parameters

TThe class implementing the wizard. It has to derive from ScriptableWizard.
titleThe title shown at the top of the wizard window.

Returns

T The wizard.

Description

Creates a wizard.

When the user hits the Create button OnWizardCreate function will be called. DisplayWizard will only show one wizard for every wizard class.


Simple Wizard Window that copies a GameObject several times.

	// 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(title: string, createButtonName: string): T;
static T DisplayWizard(string title, string createButtonName);
static def DisplayWizard(title as string, createButtonName as string) as T
static function DisplayWizard(title: string, createButtonName: string, otherButtonName: string): T;
static T DisplayWizard(string title, string createButtonName, string otherButtonName);
static def DisplayWizard(title as string, createButtonName as string, otherButtonName as string) as T

Parameters

TThe class implementing the wizard. It has to derive from ScriptableWizard.
titleThe title shown at the top of the wizard window.
classThe class implementing the wizard. It has to derive from ScriptableWizard.
createButtonNameThe text shown on the create button.
otherButtonNameThe text shown on the optional other button. Leave this parameter out to leave the button out.

Returns

T The wizard.

Description

Creates a wizard.

When the user hits the Create button OnWizardCreate function will be called. DisplayWizard will only show one wizard for every wizard class.

static function DisplayWizard(title: string, klass: Type, createButtonName: string = "Create", otherButtonName: string = ""): ScriptableWizard;
static ScriptableWizard DisplayWizard(string title, Type klass, string createButtonName = "Create", string otherButtonName = "");
static def DisplayWizard(title as string, klass as Type, createButtonName as string = "Create", otherButtonName as string = "") as ScriptableWizard

Description

TODO.