function OnWizardOtherButton () : void
Description
Allows you to provide an action when the user clicks on the other button.
This is the place where you can implement all the stuff that will
be done if the user clicks the secondary option when calling DisplayWizard.
See Also: ScriptableWizard.DisplayWizard
Scriptable Wizard with an "Other" button, in this case named "Info".
using UnityEngine;
using UnityEditor;
public class ScriptableWizardOnWizardOtherButton : ScriptableWizard {
public Transform firstObject = null;
public Transform secondObject = null;
[
MenuItem (
"Example/Show OnWizardOtherButton Usage")]
static void CreateWindow() {
ScriptableWizard.DisplayWizard(
"Click info to know the distance between the objecst",
typeof(ScriptableWizardOnWizardOtherButton),
"Finish!",
"Info");
}
void OnWizardUpdate() {
if(firstObject == null || firstObject == null) {
isValid =
false;
errorString =
"Select the objects you want to measure";
}
else {
isValid = true;
errorString =
"";
}
}
void OnWizardOtherButton () {
float distanceObjs =
Vector3.Distance(firstObject.position, secondObject.position);
EditorUtility.DisplayDialog(
"The distance between the objects is: " + distanceObjs +
" Units",
"",
"Ok");
}
void OnWizardCreate() {
return;
}
}