Exemplo n.º 1
0
    private void Awake()
    {
        if (Instance != null)
        {
            Destroy(Instance.gameObject);
        }

        Instance = this;
        DontDestroyOnLoad(gameObject);

        GameStats.Initialize();
        GameStats.Debug   = debug;
        AssetMgr.Loggable = debug;

        Updater.OnAssetsInitialized = (gameScene, onProgress) =>
        {
            Assets.AddSearchPath("Assets/HotUpdateResources/Controller");
            Assets.AddSearchPath("Assets/HotUpdateResources/Dll");
            Assets.AddSearchPath("Assets/HotUpdateResources/Material");
            Assets.AddSearchPath("Assets/HotUpdateResources/Other");
            Assets.AddSearchPath("Assets/HotUpdateResources/Prefab");
            Assets.AddSearchPath("Assets/HotUpdateResources/Scene");
            Assets.AddSearchPath("Assets/HotUpdateResources/ScriptableObject");
            Assets.AddSearchPath("Assets/HotUpdateResources/TextAsset");
            Assets.AddSearchPath("Assets/HotUpdateResources/UI");

            AssetMgr.LoadSceneAsync(gameScene, false, onProgress, (b) =>
            {
                if (!b)
                {
                    return;
                }
                Instance.Load();
                ClassBindMgr.Instantiate();
                Instance.OnHotFixLoaded();
            });
        };
    }