public class Editor_PrefabsData : ScriptableWizard {
[MenuItem("EditTools/PrefabsData",false,18)]
static void ShowWinWizard()
{
ScriptableWizard.DisplayWizard<Editor_PrefabsData>("存储小数据量的值", "create", "other");
}
void CreateWizardOtherButton()
{
Debug.LogError("值=");
}
void OnWizardUpdate()
{
}
void OnWizardCreate()
{
}
void OnWizardOtherButton()
{
Debug.LogError("值="+healthHP);
EditorPrefs.SetFloat(key_hp, healthHP);
//显示进度条
EditorUtility.DisplayProgressBar("显示的title信息,进度条", "进行的信息", 0);//开始时
EditorUtility.DisplayProgressBar("显示的title信息","进行时",1);//进行时
EditorUtility.ClearProgressBar();
}
void OnEnable()
{
healthHP = EditorPrefs.GetFloat(key_hp, healthHP);//EditorPrefs存储小数据量的值
}
public float healthHP = 10;
const string key_hp = "key_hp";
}
Editor_EditorPrefs,EditorUtility学习05
最新推荐文章于 2024-07-07 16:48:37 发布