Exemplo n.º 1
0
        public static void OpenWindow(ScriptableObject.SoliderConfigInspectorEditor _soliderConfig, int _index)
        {
            if (windows == null)
            {
                Rect rect = new Rect(Screen.width / 2, Screen.height / 2, 600, 420);
                windows = EditorWindow.GetWindowWithRect <SkillSelectionEditorWindows>(rect, true, "技能编辑面板");
            }

            soliderConfig      = _soliderConfig;
            soliderConfigIndex = _index;
            toggleInitArray    = new bool[Enum.GetValues(typeof(SkillFlag)).Length];
            toggleRuntimeArray = new bool[Enum.GetValues(typeof(SkillFlag)).Length];
            //createCommanderEditor.editorTarget.skillMastery

            if ((int)_soliderConfig.editorTarget.soliderDataArray[soliderConfigIndex].skillMastery == -1)
            {
                for (int i = 1; i < toggleInitArray.Length; i++)
                {
                    toggleInitArray[i] = toggleRuntimeArray[i] = true;
                }
            }
            else if ((int)_soliderConfig.editorTarget.soliderDataArray[soliderConfigIndex].skillMastery == 0)
            {
                toggleInitArray[0] = toggleRuntimeArray[0] = true;
            }
            else
            {
                for (int i = 1; i < toggleInitArray.Length; i++)
                {
                    toggleInitArray[i] = toggleRuntimeArray[i] = (_soliderConfig.editorTarget.soliderDataArray[soliderConfigIndex].skillMastery &
                                                                  (SkillFlag)Enum.GetValues(typeof(SkillFlag)).GetValue(i)) != 0;
                }
            }
            windows.Show();
        }
Exemplo n.º 2
0
 private void OnDestroy()
 {
     windows = null;
     createCommanderEditor = null;
     soliderConfig         = null;
     soliderConfigIndex    = 0;
     toggleInitArray       = null;
 }