DisplayWizard(에디터로 쓸모가 많을 듯 한..)
Unity3D/Script / 2012. 12. 4. 14:51
ScriptableWizard.DisplayWizard
static function DisplayWizard.<T> (title : String) : T
Parameters
Name | Description |
---|---|
T | The class implementing the wizard. It has to derive from ScriptableWizard. |
title | The 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.<T> (title : String, createButtonName : String, otherButtonName : String) : T
static function DisplayWizard (title : String, klass : System.Type, createButtonName : String = "Create", otherButtonName : String = "") : ScriptableWizard
Parameters
Name | Description |
---|---|
T | The class implementing the wizard. It has to derive from ScriptableWizard. |
title | The title shown at the top of the wizard window. |
class | The class implementing the wizard. It has to derive from ScriptableWizard. |
createButtonName | The text shown on the create button. |
otherButtonName | The text shown on the optional other button. Leave this parameter out to leave the button out. |
Returns
ScriptableWizard - 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.
출처 : http://docs.unity3d.com/Documentation/ScriptReference/ScriptableWizard.DisplayWizard.html
반응형
'Unity3D > Script' 카테고리의 다른 글
InGame Button (0) | 2012.12.14 |
---|---|
InvokeRepeating (0) | 2012.12.07 |
Replace game object with prefab? (0) | 2012.12.04 |
폰트의 픽셀정보로 문자열을 Mesh들로 생성하여 보여주기 (0) | 2012.11.24 |
Interpolate (0) | 2012.11.22 |