private void UpdateInput(UpdateInputMessage msg) { if (!msg.Previous.Dash && msg.Current.Dash) { _controller.gameObject.SendMessageTo(ActivateDashMessage.INSTANCE, _controller.transform.parent.gameObject); } else if (!msg.Previous.Attack && msg.Current.Attack) { _controller.gameObject.SendMessageTo(ActivateAttackMessage.INSTANCE, _controller.transform.parent.gameObject); } }
private void UpdateInput(UpdateInputMessage msg) { var direction = Vector2.zero; if (msg.Current.Up) { direction.y = 1; } else if (msg.Current.Down) { direction.y = -1; } if (msg.Current.Left) { direction.x = -1; } else if (msg.Current.Right) { direction.x = 1; } _setDirectionMsg.Direction = direction; _controller.gameObject.SendMessageTo(_setDirectionMsg, _controller.transform.parent.gameObject); }
private void UpdateInput(UpdateInputMessage msg) { _setDirectionMsg.Direction = msg.Current.Direction; _controller.gameObject.SendMessageTo(_setDirectionMsg, _controller.transform.parent.gameObject); }