public void Update() { if (UnityEngine.Input.anyKey) { AnyInput?.Invoke(Event.AnyInput.Instance); } }
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(); } }