方法与PlayerPrefs类似
保存修改后的数据,避免初始化
using UnityEditor;
using UnityEngine;
public class WizardEditor : ScriptableWizard
{
public int healthValue = 10;
public int speedValue = 10;
[MenuItem("Tools/CrerteWizard")]
static void CrerteWizard()
{
ScriptableWizard.DisplayWizard<WizardEditor>("title", "button1","button2");
}
void OnEnable()
{
healthValue = EditorPrefs.GetInt("healthValue", healthValue);
speedValue = EditorPrefs.GetInt("speedValue", speedValue);
}
void OnWizardUpdate()
{
EditorPrefs.SetInt("healthValue", healthValue);
EditorPrefs.SetInt("speedValue", speedValue);
}
}