Пример #1
0
        private async void LoadBundle()
        {
            GameObject go = await FinalPool.GetGameObjectAsync("Assets/BBGo/FinalPatch/Demo/Bundles/Cube_B.prefab");

            go.transform.position = Random.insideUnitSphere * 5;
            list.Enqueue(go);
        }
Пример #2
0
        private void Update()
        {
            if (Input.GetKeyDown(KeyCode.Q))
            {
                LoadBundle();
            }
            if (Input.GetKeyDown(KeyCode.W))
            {
                UnloadBundle();
            }
            if (Input.GetKeyDown(KeyCode.Z))
            {
                FinalPool.Reset();
                FinalLoader.Reset();
                FinalPatcher.Reset();

                FinalPatcher.AutoPatch();
            }

            if (Input.GetKeyDown(KeyCode.A))
            {
                LoadScene();
            }

            if (Input.GetKeyDown(KeyCode.S))
            {
                UnloadScene();
            }
        }
Пример #3
0
        private void UnloadBundle()
        {
            if (list.Count == 0)
            {
                return;
            }

            FinalPool.ReleaseGameObject(list.Dequeue());
        }
Пример #4
0
        private void Awake()
        {
            DontDestroyOnLoad(gameObject);

            FinalPatchData data = Resources.Load <FinalPatchData>("FinalPatchData");

            FinalPool.Init(data);
            FinalLoader.Init(data);
            FinalPatcher.Init(data, deployDataUrl, channel);
        }
Пример #5
0
        public static async Task LoadSceneAsync(string sceneName, LoadSceneMode mode)
        {
            if (mode == LoadSceneMode.Single)
            {
                //unload all assets before a scene loaded with single mode
                FinalPool.Reset();
                Reset();
            }
            await LoadAssetAsync <Object>(sceneName);

            SceneManager.LoadScene(sceneName, mode);
        }
Пример #6
0
 private void Update()
 {
     FinalPool.Update();
 }