// 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;
 }
 /// <summary>
 /// Start animation still (when in center position) related FXs
 /// </summary>
 private void AnimationStill(PositionAnimationFX anim, string what)
 {
     if(posFX == anim)
     {
         if(willShake) shakeFX.PlayAnimation();
         clip.PlaySFX();
         clip.PlayCurrentClip();
         Invoke ("FinalAnimation", sceneStillDuration);
     }
 }
示例#3
0
    // 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);
    }