void Start() { anim = new ScalingLerpCoroutine( gameObject, fromScale, toScale, scaleTime ); StartCoroutine(Cycle()); }
IEnumerator EndCycle() { yield return(new WaitForSeconds(AnimationDuration)); //show heart heart.SetActive(true); //spawn in love audio Instantiate(inLoveAudio, transform.position, Quaternion.identity); //make negstone a whole game object gameObject.transform.parent = negStone.transform; littleNeg.transform.parent = negStone.transform; //title animation & neg stone rising titleTransformAnimation = new TransformLerpCoroutine( gameTitle, gameTitle.transform.position, titleToPos, TitleScaleAnimationDuration ); titleScalingAnimation = new ScalingLerpCoroutine( gameTitle, gameTitle.transform.localScale, titleToLocalScale, TitleScaleAnimationDuration ); negStoneTransformAnimation = new TransformLerpCoroutine( negStone, negStone.transform.position, negStoneToPos, TitleScaleAnimationDuration ); StartCoroutine(titleTransformAnimation.AnimationCoroutine()); StartCoroutine(titleScalingAnimation.AnimationCoroutine()); yield return(new WaitForSeconds(TitleScaleAnimationDuration)); StartCoroutine(negStoneTransformAnimation.AnimationCoroutine()); yield return(new WaitForSeconds(NegStoneRisingDuration)); //activate win scene canvas winSceneCanvas.SetActive(true); }