// Use this for initialization void Awake() { posFX = GetComponent<PositionAnimationFX>(); scaleFX = GetComponent<ScaleAnimationFX>(); if(willShake) shakeFX = GetComponent<ShakeAnimationFX>(); clip = GetComponent<SceneClip>(); initialCutscenePos = transform.localPosition; initialScale = transform.localScale; }
private void EndAnimation(ScaleAnimationFX anim, string what) { /* GameObject starParticle = GameObject.Instantiate(startAnimationPrefab) as GameObject; starParticle.transform.parent = this.transform; starParticle.transform.localPosition = new Vector3(0, 0, 1); starParticle.transform.parent = null; */ Invoke("StartFinalAnimation", stillDuration); }
private void AnimationCompleted(ScaleAnimationFX anim, string what) { transform.localScale = initialScale; gameObject.SetActive(false); }
// Use this for initialization void Start() { if (animationObject != null) { positionAnimation = animationObject.GetComponent<PositionAnimationFX>(); scaleAnimation = animationObject.GetComponent<ScaleAnimationFX>(); animationObject.SetActive(false); animationSprite = new UIScaledSprite(); animationSprite.SetComponents(animationObject.GetComponent<UISprite>(), animationObject.GetComponent<UIStretch>()); initialPosition = animationSprite.GetPosition(); initialScale = animationSprite.GetRelativeScale(); } toys = new List<Toy>(Mathf.Max(toysOdd.Count, toysEven.Count)); for (int i = 0; i < toys.Capacity; i++) toys.Add(new Toy()); foreach (UIScaledSprite sprite in toysOdd) { sprite.Initialize(); sprite.Disable(); } foreach (UIScaledSprite sprite in toysEven) { sprite.Initialize(); sprite.Disable(); } activeList = toysOdd; if (GameManager.WasInitialized()) { GameManager.Instance.InitializeLevelCompleteSequence(this); } uiRoot.SetActive(false); Sherlock.Instance.PlaySequenceInstructions(message, null); player.spriteName = ApplicationState.Instance.selectedCharacter + "CircleColor"; Invoke("ShowLevelComplete", message.GetCommulativeDuration() + 0.5f); }
/// <summary> /// Calls function to start displaying the toys /// </summary> private void EndDisplayToy(ScaleAnimationFX scAnim, string whatEffect) { activeList [currentToy].UpdateColor(finalToyAtlas, toys [currentToy].color); animationObject.SetActive(false); // Go to next toy currentToy++; Invoke("DisplayToy", timeBetweenRewards); }
/// <summary> /// Signal the end of the animation to the clip /// </summary> private void CloseClip(ScaleAnimationFX anim, string what) { clip.AnimationEnd(); }