Exemple #1
0
        public IEnumerator ShipChangeCoroutine(ShipModel Ship, int index)
        {
            bool isCharaChanged = false;

            isShipChanging = true;
            FadeLabel(isFadeIn: false);
            if (!isFirstCall)
            {
                TweenPos.onFinished.Clear();
                TweenPos.PlayReverse();
                this.DelayAction(TweenPos.duration, delegate
                {
                    this.Live2DRender.ChangeCharacter(Ship, -1, isDamaged: false);
                    isCharaChanged = true;
                });
                while (!isCharaChanged)
                {
                    yield return(null);
                }
            }
            else
            {
                Live2DRender.ChangeCharacter(Ship, -1, isDamaged: false);
                isFirstCall = false;
            }
            float size = 1.2f;
            int   posy = -48;

            if (Ship.Lov > 200)
            {
                size = 1.25f;
                posy = -60;
            }
            if (Ship.Lov > 500)
            {
                size = 1.3f;
                posy = -72;
            }
            if (Ship.Lov > 700)
            {
                size = 1.35f;
                posy = -84;
            }
            Live2DRender.transform.localScale = new Vector3(size, size, size);
            Live2DRender.transform.AddLocalPositionY(posy);
            yield return(new WaitForEndOfFrame());

            if (Ship.IsMarriage())
            {
                SakuraPar.Play();
                Ring.SetActive(isActive: true);
            }
            else
            {
                SakuraPar.Stop();
                Ring.SetActive(isActive: false);
            }
            TweenPos.onFinished.Clear();
            TweenPos.PlayForward();
            this.DelayAction(TweenPos.duration, delegate
            {
                this.ShipVoice = ShipUtils.PlayEndingVoice(Ship, 28);
                this.SetLabel(Ship);
                this.FadeLabel(isFadeIn: true);
                this.isShipChanging = false;
            });
            yield return(new WaitForEndOfFrame());

            SingletonMonoBehaviour <Live2DModel> .Instance.ChangeMotion(Live2DModel.MotionType.Secret);

            SingletonMonoBehaviour <Live2DModel> .Instance.Play();
        }