Editor_EditorPrefs,EditorUtility学习05

来源:互联网 发布:python取消注释快捷键 编辑:程序博客网 时间:2024/06/13 12:40
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";}
原创粉丝点击