Esempio n. 1
0
        /// <summary>
        /// Loop変更実行
        /// </summary>
        /// <returns></returns>
        private async UniTask execAsync(Param nextParam)
        {
            IsFading = true;
            await fader.FadeOutToBlack(this.GetCancellationTokenOnDestroy());

            IsFading = false;

            // 終了待ち / 破棄
            if (param != null && param.Obj != null)
            {
                await param.Obj.Exit(nextParam.Current);

                Destroy(param.Obj.gameObject);
                param = null;
            }

            // リセット処理
            mainCamera.transform.localPosition = new Vector3(0, 0, -10f);

            // 次のLoopを読み込んでスタックに積む
            var loopResource = LoopFunction.GetParamLoopResource(nextParam.Current);

            nextParam.Obj = loadLoop(loopResource.PrefabPath);

            // Param更新
            param = nextParam;

            // GC実行
            System.GC.Collect();

            // 読み込み待ち
            await param.Obj.Enter(param.BridgeParam);

            IsFading = true;
            await fader.FadeInToScene(this.GetCancellationTokenOnDestroy());

            IsFading = false;
        }