示例#1
0
    void OnGUI()
    {
        EditorGUILayout.BeginVertical();

        EditorGUILayout.BeginHorizontal();
        int id = _skillInfo.id;

        if (id == 0)
        {
            string value = GetPlayerPrefs(KEY_SKILL_ID);
            id = value == string.Empty ? 0 : int.Parse(value);
        }
        _skillInfo.id = EditorGUILayout.IntField("技能id:", id);
        SetPlayerPrefs(KEY_SKILL_ID, _skillInfo.id);

        if (GUILayout.Button("加载配置"))
        {
            LoadSkillInfo();
        }
        if (GUILayout.Button("添加事件"))
        {
            SkillUtils.InstanceEvent(SKILL_EVENT_TYPE.动作, _skillInfo, null, 0, 0);
        }
        GUI.backgroundColor = Color.green;
        if (GUILayout.Button("保存"))
        {
            Save();
        }
        GUI.backgroundColor = Color.white;
        EditorGUILayout.EndHorizontal();

        _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos, false, false);
        _skillInfo.DrawUI();
        EditorGUILayout.EndScrollView();

        EditorGUILayout.Separator();
        EditorGUILayout.EndVertical();
    }