private void PlayerMovement_onKeyPressedEventHandler(object sender, OnKeyPressedEvenArgs e) { OnMovedEventHandler(new OnMovedEventArgs(transform.position, e.Horizontal)); transform.Translate(new Vector3(e.Horizontal.x * Time.deltaTime * this.Speed, 0, 0)); transform.Translate(new Vector3(e.Horizontal.y * Time.deltaTime * this.Speed, 0, 0)); transform.Translate(new Vector3(0, 0, e.Vertical.x * Time.deltaTime * this.Speed)); transform.Translate(new Vector3(0, 0, e.Vertical.y * Time.deltaTime * this.Speed)); }
private void PlayerShoot_onKeyPressedEventHandler(object sender, OnKeyPressedEvenArgs e) { if (e.Shoot == true && counter > delaytime) { Shoot(); } counter += Time.deltaTime; }
private void OnKeyPressed(OnKeyPressedEvenArgs e) { onKeyPressedEventHandler?.Invoke(this, e); }