示例#1
0
        public void DrawAcModules()
        {
            GUILayout.BeginVertical(GUILayout.Width(ACStyles.ModuleViewWidth));
            GUILayout.Label("MODULES " + _childModules.Count);
            _moduleScrollPos = GUILayout.BeginScrollView(_moduleScrollPos);

            TryInitDrawAcModulesParams();

            for (int i = 0; i < _childModules.Count; i++)
            {
                var childModule = _childModules[i];

                bool lastToggle = _moduleToggleStates[i];
                _moduleToggleStates[i] = GUILayout.Toggle(_moduleToggleStates[i], childModule.Name, ACWindow.ACStyles.ModuleButton);

                if (!lastToggle && _moduleToggleStates[i])
                {
                    EditorWindowHelper.ResetToggleStates(_moduleToggleStates, i);
                    _curSelectModule = childModule;
                }
            }
            GUILayout.EndScrollView();
            GUILayout.EndVertical();

            if (_curSelectModule != null)
            {
                _curSelectModule.DrawAcPrefabs();
            }
        }
示例#2
0
 private void TryInitDrawAcModulesParams()
 {
     if (_moduleToggleStates.Count == 0)
     {
         int moduleConut = _childModules.Count;
         if (moduleConut > 0)
         {
             _curSelectModule    = _childModules[0];
             _moduleToggleStates = EditorWindowHelper.InitToggleStates(moduleConut);
         }
     }
 }
示例#3
0
        public ACPrefab(string file, ACModule parentModule)
        {
            File      = file;
            AssetFile = EditorWindowHelper.DataPathToAssetPath(file);

            ParentModule = parentModule;

            string fileName = Path.GetFileName(file);
            {
                fileName = Regex.Replace(fileName, ".*?_", "", RegexOptions.IgnoreCase);
                Name     = Regex.Replace(fileName, ".prefab", "", RegexOptions.IgnoreCase);
            }
        }
示例#4
0
 private void CollectAllPrefabs(ACModule acModel)
 {
     if (acModel.ModuleType == ModuleType.Single)
     {
         ACSingleModule acSingleModule = acModel as ACSingleModule;
         if (acSingleModule != null)
         {
             _allAcPrefabs.Add(acSingleModule.ChildPrefab);
         }
     }
     else
     {
         ACMultiMoudle acMultiMoudle = acModel as ACMultiMoudle;
         if (acMultiMoudle != null)
         {
             _allAcPrefabs.AddRange(acMultiMoudle.ChildPrefabs);
         }
     }
 }
示例#5
0
 private void AddAcModule(ACModule acModule)
 {
     _childModules.Add(acModule);
 }