예제 #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();
 }