public IEnumerator ChangeFinalShip(ShipModel ship, EndingStaffRoll StaffRoll) { ShipUtils.StopShipVoice(); Live2DRender.ChangeCharacter(ship, -1, isDamaged: false); TweenPos.to = new Vector3(400f, 0f, 0f); TweenPos.from = new Vector3(1200f, 0f, 0f); while (!StaffRoll.isFinishRoll) { yield return(null); } if (ship.IsMarriage()) { SakuraPar.Play(); } else { SakuraPar.Stop(); } TweenPos.onFinished.Clear(); TweenPos.PlayForward(); TweenPos.duration = 2f; Live2DRender.transform.localScale = new Vector3(1.5f, 1.5f, 1.5f); Live2DRender.transform.AddLocalPositionY(-120f); this.DelayAction(TweenPos.duration, delegate { this.isShipChanging = false; }); yield return(new WaitForEndOfFrame()); SingletonMonoBehaviour <Live2DModel> .Instance.ChangeMotion(Live2DModel.MotionType.Secret); SingletonMonoBehaviour <Live2DModel> .Instance.Play(); }
private void OnDestroy() { if (UpdateCharacterCor != null) { StopCoroutine(UpdateCharacterCor); UpdateCharacterCor = null; } if (UpdateSideChangeCor != null) { StopCoroutine(UpdateSideChangeCor); UpdateSideChangeCor = null; } ShipView = null; StaffRoll = null; if (ShipModels != null) { ShipModels.Clear(); } UpdateCharacterCor = null; UpdateSideChangeCor = null; key = null; foreverLabel = null; if (SingletonMonoBehaviour <Live2DModel> .exist()) { SingletonMonoBehaviour <Live2DModel> .Instance.isDontRelease = false; } }