Ejemplo n.º 1
0
 public void Update()
 {
     if (UnityEngine.Input.anyKey)
     {
         AnyInput?.Invoke(Event.AnyInput.Instance);
     }
 }
Ejemplo n.º 2
0
    protected virtual void Update()
    {
        bool anyInput = true;

        if (CancelPressed())
        {
            Cancel();
        }
        else if (ResetPressed())
        {
            Reset();
        }
        else if (ChangePerspectivePressed())
        {
            if (ChangePerspectiveEvent != null)
            {
                ChangePerspectiveEvent.Invoke();
            }
        }
        else
        {
            Direction direction = GetBoardDirection();
            if (direction != Direction.NONE && MoveBoardEvent != null)
            {
                MoveBoardEvent.Invoke(direction);
            }
            direction = ChangeDirectionForCube(direction);
            if (direction != Direction.NONE && MoveCubeEvent != null)
            {
                MoveCubeEvent.Invoke(direction);
            }
            else
            {
                anyInput = false;
            }
        }
        if (anyInput && AnyInput != null)
        {
            AnyInput.Invoke();
        }
    }