Beispiel #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();
        }
    }
Beispiel #2
0
 public void OnPointerClick(PointerEventData pointerEventData)
 {
     if (pointerEventData.position.x > screenMiddle)
     {
         RightInputEvent?.Invoke();
     }
     else
     {
         LeftInputEvent?.Invoke();
     }
 }