void Update() { //get inputs _mouseInput.x = Input.GetAxisRaw("Mouse X") * _lookSensitivity.x; _mouseInput.y = Input.GetAxisRaw("Mouse Y") * _lookSensitivity.y; _movementInput.x = Input.GetAxisRaw("Horizontal"); _movementInput.y = Input.GetAxisRaw("Vertical"); _movementInput.Normalize(); if (!_invertY) { _mouseInput.y *= -1f; } if (Input.GetKeyDown(KeyCode.T)) { GlobalEventBus.Raise(GlobalEvent.ToggleSlowMotion); } if (Input.GetKeyDown(KeyCode.Space)) { _entity.events.Raise(LocalEvent.Jump); } if (Input.GetKey(KeyCode.Mouse0)) { _entity.events.Raise(LocalEvent.Fire); } _entity.events.Raise(LocalEvent.UpdateAimingInput, Input.GetKey(KeyCode.Mouse1)); _entity.events.Raise(LocalEvent.UpdateCrouchInput, Input.GetKey(KeyCode.LeftControl)); }
public void given_a_handler_subscribed_at_an_outer_scope() { globalBus = new GlobalEventBus(); globalBus.Subscribe<EventMessage>(outerSubscriber); }
void Awake() { GlobalEventBus.Initialize(); }
void Start() { GlobalEventBus.Subscribe(GlobalEvent.ToggleSlowMotion, (object[] args) => Toggle()); }