Exemple #1
0
 private void Awake()
 {
     if (lineAnimator == null)
     {
         lineAnimator = this;
     }                                                  // Be the one
 }
    private void AddInput(Direction input)
    {
        switch (InputList.Count)
        {
        case 0:
            if (PillarFinisherUsed)
            {
                if (PillarTutorial)
                {
                    PillarTutorial.PlaySecondHit();
                }
            }
            break;

        case 1:
            if (PillarFinisherUsed)
            {
                if (PillarTutorial)
                {
                    PillarTutorial.PlayThirdHit();
                }
            }
            break;

        case 2:
            if (PillarFinisherUsed)
            {
                if (PillarTutorial)
                {
                    PillarTutorial.PlayThirdHit();
                }
            }
            break;

        case 3:
            if (PillarFinisherUsed)
            {
                if (PillarTutorial)
                {
                    PillarTutorial.PlayThirdHit();
                }
            }
            break;
        }

        //might be good to have the state of the element to help with the color
        //so it should be LeftToRightAnim(runic)
        InputList.Add(input);
        if (InputList.Count > 1)
        {
            switch (InputList[InputList.Count - 2])
            {
            case Direction.left:
                switch (InputList[InputList.Count - 1])
                {
                case Direction.up:
                    FinisherLineAnimator.LeftToUpAnim(CurrentFinisherElement);
                    break;

                case Direction.down:
                    FinisherLineAnimator.LeftToDownAnim(CurrentFinisherElement);
                    break;

                case Direction.right:
                    FinisherLineAnimator.LeftToRightAnim(CurrentFinisherElement);
                    break;
                }
                break;

            case Direction.right:
                switch (InputList[InputList.Count - 1])
                {
                case Direction.up:
                    FinisherLineAnimator.RightToUpAnim(CurrentFinisherElement);
                    break;

                case Direction.left:
                    FinisherLineAnimator.RightToLeftAnim(CurrentFinisherElement);
                    break;

                case Direction.down:
                    FinisherLineAnimator.RightToDownAnim(CurrentFinisherElement);
                    break;
                }
                break;

            case Direction.up:
                switch (InputList[InputList.Count - 1])
                {
                case Direction.right:
                    FinisherLineAnimator.UpToRightAnim(CurrentFinisherElement);
                    break;

                case Direction.left:
                    FinisherLineAnimator.UpToLeftAnim(CurrentFinisherElement);
                    break;
                }
                break;

            case Direction.down:
                switch (InputList[InputList.Count - 1])
                {
                case Direction.right:
                    FinisherLineAnimator.DownToRightAnim(CurrentFinisherElement);
                    break;

                case Direction.left:
                    FinisherLineAnimator.DownToLeftAnim(CurrentFinisherElement);
                    break;
                }
                break;

            default:
                break;
            }
        }
        else
        {
            switch (input)
            {
            case Direction.left:
                CurrentFinisherElement = ElementType.Fire;
                break;

            case Direction.up:
                CurrentFinisherElement = ElementType.Electricity;
                break;

            case Direction.right:
                CurrentFinisherElement = ElementType.Ice;
                break;
            }
        }
    }