ユーザーが他のボタンをクリックしたときにアクションを提供できます
ユーザーが 2 番目のオプションをクリックした場合に行われるすべてのものを実装することができる場所です。
これは DisplayWizard を呼び出すとき、
参照: ScriptableWizard.DisplayWizard
ScriptableWizard と "Other" ボタン。この例での名前は "Info" です。
// Display a window showing the distance between two objects when clicking the Info button.
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 objects", 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 = ""; } } // Called when you press the "Info" button. void OnWizardOtherButton () { float distanceObjs = Vector3.Distance(firstObject.position, secondObject.position); EditorUtility.DisplayDialog( "The distance between the objects is: " + distanceObjs + " Units", "", "Ok"); } // Called when you press the "Finish!" button. void OnWizardCreate() { return; } }