Example #1
0
    private void OnInput(InputZoneData.Direction direction)
    {
        int index = Inputs.Count;

        if (direction == NeedInputs[index])
        {
            if (index == NeedInputs.Length - 1)
            {
                _playerInput.InputEvent -= OnInput;
                _arrows.Disactivate();
                RightInputEvent?.Invoke();
                return;
            }
            _arrows.ArrowsList[index].GetComponent <Arrow>().Animate(true);
            Inputs.Add(direction);
        }
        else
        {
            for (int i = 0; i < NeedInputs.Length; i++)
            {
                _arrows.ArrowsList[i].GetComponent <Arrow>().Animate(false);
            }
            Inputs.Clear();
        }
    }
Example #2
0
    private Vector3 RotateArrow(InputZoneData.Direction direction)
    {
        float rotZ = 0;

        switch (direction)
        {
        case InputZoneData.Direction.Right:
            rotZ = 180;
            break;

        case InputZoneData.Direction.Up:
            rotZ = 270;
            break;

        case InputZoneData.Direction.Left:
            rotZ = 0;
            break;

        case InputZoneData.Direction.Down:
            rotZ = 90;
            break;
        }

        return(new Vector3(0, 0, rotZ));
    }