예제 #1
0
 public override void Awake()
 {
     if (Ins == null)
     {
         Ins = this;
     }
     //创建临时对象
     TempGO           = new GameObject("TempGO");
     TempGO.hideFlags = HideFlags.HideInHierarchy;
     //使应用程序无法关闭
     Application.wantsToQuit += OnWantsToQuit;
     WinUtil.DisableSysMenuButton();
     //创建必要的文件目录
     FileUtil.EnsureDirectory(Const.Path_Dev);
     FileUtil.EnsureDirectory(Const.Path_Screenshot);
     FileUtil.EnsureDirectory(Const.Path_LocalDB);
     FileUtil.EnsureDirectory(Const.Path_CloudDB);
     //添加必要的组件
     SetupComponent <Videoer>();
     SetupComponent <Prefers>();
     SetupComponent <Feedback>();
     SetupComponent <FPSCounter>();
     SetupComponent <GlobalMonoMgr>();
     SetupComponent <GlobalUITextMgr>();
     SetupComponent <IMUIErrorCatcher>();
     SetupComponent <IMUIWaterMarker>();
     SetupComponent <IMUIOptions>();
     //初始化LuaReader
     LuaReader.Init(BuildConfig.NameSpace);
     DOTween.Init();
     DOTween.instance.transform.SetParent(Trans);
     Timing.Instance.transform.SetParent(Trans);
     QueueHub.Instance.transform.SetParent(Trans);
     Delay.Ins.transform.SetParent(Trans);
     RapidGUIBehaviour.Instance.transform.SetParent(Trans);
     //创建所有DataParse
     OnProcessAssembly();
     base.Awake();
     //添加SDK组件
     OnAddPlatformSDKComponet();
     //读取命令行参数
     OnProcessCMDArgs();
     DontDestroyOnLoad(this);
     //携程
     CommonCoroutineter    = new Coroutineter("Common");
     MainUICoroutineter    = new Coroutineter("MainUI");
     BattleCoroutineter    = new Coroutineter("Battle");
     SubBattleCoroutineter = new Coroutineter("SubBattle");
     Pos = Const.VEC_GlobalPos;
     //CALLBACK
     LoaderMgr.Callback_OnAllLoadEnd1 += OnAllLoadEnd1;
     LoaderMgr.Callback_OnAllLoadEnd2 += OnAllLoadEnd2;
     LuaMgr.Callback_OnParseStart     += OnLuaParseStart;
     LuaMgr.Callback_OnParseEnd       += OnLuaParseEnd;
     //Test
     OnTest();
 }
예제 #2
0
        /// <summary>
        /// 确保标准项目文件夹存在
        /// </summary>
        public static void EnsureProjectFiles()
        {
            FileUtil.EnsureDirectory(Const.Path_Arts);
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Arts, "Scene"));

            FileUtil.EnsureDirectory(Const.Path_Bundles);

            FileUtil.EnsureDirectory(Const.Path_Resources);
            FileUtil.EnsureDirectory(Const.Path_ResourcesConfig);
            FileUtil.EnsureDirectory(Const.Path_ResourcesTemp);
            FileUtil.EnsureDirectory(Const.Path_ResourcesText);
            FileUtil.EnsureDirectory(Const.Path_ResourcesScriptTemplate);
            FileUtil.EnsureDirectory(Const.Path_ResourcesConst);

            FileUtil.EnsureDirectory(Const.Path_Funcs);
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "GlobalMgr"));
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "Main"));
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "Table"));
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "UI"));
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "UnitMgr"));
            FileUtil.EnsureDirectory(Path.Combine(Const.Path_Funcs, "UnitMono"));
            FileUtil.EnsureDirectory(Const.Path_StreamingAssets);
            TemplateTool.RefreshTemplates(Const.Path_Editor, false);
        }
예제 #3
0
 public void Init(string path)
 {
     BasePath = path;
     FileUtil.EnsureDirectory(path);
 }