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.OnWizardCreate()

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

Descripción

This is called when the user clicks on the Create button.

Here you perform any final creation/modification actions. After OnCreateWizard is called, the wizard is automatically closed.

See Also: ScriptableWizard.DisplayWizard


ScriptableWizard window for selecting GameObjects of a certain "type".


        
// Editor Script that lets you "Select" all the GameObjects that have a certain Component.

using UnityEngine; using UnityEditor; using System.Collections;

public class ScriptableWizardOnWizardCreate : ScriptableWizard { public string componentName = "Camera";

[MenuItem ("Example/OnWizardCreate example")] public static void SelectAllOfTypeMenuIem() { ScriptableWizard.DisplayWizard( "Select objects of type ...", typeof(ScriptableWizardOnWizardCreate), "Select"); }

void OnWizardCreate() { Object[] objs = FindObjectsOfType(typeof(GameObject)); ArrayList selectionBuilder = new ArrayList(); foreach (GameObject go in objs) { if(go.GetComponent<componentName>()) selectionBuilder.Add(go); } Selection.objects = selectionBuilder.ToArray(typeof(GameObject)) as GameObject[]; } }