Version: 5.3 (switch to 5.4b)
IdiomaEnglish
  • C#
  • JS

Idioma de script

Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.

ScriptableWizard.DisplayWizard

Sugiere un cambio

¡Éxito!

Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.

Cerrar

No se puedo enviar

Por alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.

Cerrar

Cancelar

Cambiar al Manual
public static function DisplayWizard(title: string): T;
public static T DisplayWizard(string title);

Parámetros

title The title shown at the top of the wizard window.

Valor de retorno

T The wizard.

Descripción

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.


        
// 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); } }

public static function DisplayWizard(title: string, createButtonName: string): T;
public static T DisplayWizard(string title, string createButtonName);
public static function DisplayWizard(title: string, createButtonName: string, otherButtonName: string): T;
public static T DisplayWizard(string title, string createButtonName, string otherButtonName);

Parámetros

title The title shown at the top of the wizard window.
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.

Valor de retorno

T The wizard.

Descripción

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.


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

Parámetros

title The title shown at the top of the wizard window.
klass 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.

Valor de retorno

ScriptableWizard The wizard.

Descripción

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.