示例#1
0
        public static ACSingleModule CreateAcSingleModule(string prefabFile, ACScene parentScene)
        {
            var singleModuleConfig = new ACSingleModule(prefabFile, parentScene);

            singleModuleConfig.TryInitDrawAcPrefabsParams();

            return(singleModuleConfig);
        }
示例#2
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);
         }
     }
 }
示例#3
0
        public static bool CreateAcScene(string folderPath, out ACScene acScene)
        {
            acScene = new ACScene(folderPath);

            // 初始化子文件夹下的配置(子文件夹的Prefab)
            var moduleFolders = Directory.GetDirectories(folderPath);

            for (int i = 0; i < moduleFolders.Length; i++)
            {
                ACMultiMoudle multiModule;
                if (ACMultiMoudle.CreateAcMultiModule(moduleFolders[i], acScene, out multiModule))
                {
                    acScene.AddAcModule(multiModule);
                }
            }

            // 初始化当前文件夹下的配置(非子文件夹的Prefab)
            var singlePrefabFiles = Directory.GetFiles(folderPath, "*.prefab", SearchOption.TopDirectoryOnly);

            if (singlePrefabFiles.Length >= 0)
            {
                for (int i = 0; i < singlePrefabFiles.Length; i++)
                {
                    ACSingleModule singleModule = ACSingleModule.CreateAcSingleModule(singlePrefabFiles[i], acScene);
                    acScene.AddAcModule(singleModule);
                }
            }

            if (acScene._childModules.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }