Example #1
0
 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));
 }
Example #2
0
 private void PlayerShoot_onKeyPressedEventHandler(object sender, OnKeyPressedEvenArgs e)
 {
     if (e.Shoot == true && counter > delaytime)
     {
         Shoot();
     }
     counter += Time.deltaTime;
 }
Example #3
0
 private void OnKeyPressed(OnKeyPressedEvenArgs e)
 {
     onKeyPressedEventHandler?.Invoke(this, e);
 }