I am trying to create my own ScriptableWizard , I put my code at the folder Assets/Editor , the file name is the same with the class name. But when I open it using a menu item ,I got the error:
Instance of MyScriptableWizard couldn't be created because there is no script with that name.
UnityEditor.ScriptableWizard:DisplayWizard(String, Type)
MyScriptableWizard:CreateWizard() (at Assets/Editor/MyScriptableWizard .cs:24)
Here is code:
using UnityEngine;
using UnityEditor;
using System.Collections;
// A Wizard class that generates it's fields from public properties
public class MyScriptableWizard : ScriptableWizard
{
//---------------------------------
// Reflection Fields
//---------------------------------
// An auto generated field
public string myGeneratedField;
//---------------------------------
// Static Methods
//---------------------------------
// Create the wizard
[MenuItem ("GameObject/Wizards/My Scriptable Wizard")]
static void CreateWizard ()
{
MyScriptableWizard wizard = DisplayWizard<MyScriptableWizard>("My Scriptable Wizard", "Wizard Create", "Wizard Other Button");
}
//==================================
// Messages
//==================================
// Called every frame when the wizard is visible.
void OnDrawGizmos()
{
}
// This is called when the user clicks on the Create button.
void OnWizardCreate()
{
}
// This is called when the wizard is opened or whenever the user
// changes something in the wizard.
void OnWizardUpdate()
{
}
// Allows you to provide an action when the user clicks on the
// other button.
void onWizardOtherButton()
{
}
}