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); }
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(); } }
private void UnloadBundle() { if (list.Count == 0) { return; } FinalPool.ReleaseGameObject(list.Dequeue()); }
private void Awake() { DontDestroyOnLoad(gameObject); FinalPatchData data = Resources.Load <FinalPatchData>("FinalPatchData"); FinalPool.Init(data); FinalLoader.Init(data); FinalPatcher.Init(data, deployDataUrl, channel); }
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); }
private void Update() { FinalPool.Update(); }