예제 #1
0
파일: DPad.cs 프로젝트: HablaH/Modul3
 private void SetDirection()
 {
     if (buttons[0].IsPressed && buttons[1].IsPressed)
     {
         direction.Set(45);
     }
     if (buttons[0].IsPressed && buttons[3].IsPressed)
     {
         direction.Set(315);
     }
     if (buttons[1].IsPressed && buttons[2].IsPressed)
     {
         direction.Set(135);
     }
     if (buttons[2].IsPressed && buttons[3].IsPressed)
     {
         direction.Set(225);
     }
     if (buttons[0].IsPressed)
     {
         direction.Set(360);
     }
     if (buttons[1].IsPressed)
     {
         direction.Set(90);
     }
     if (buttons[2].IsPressed)
     {
         direction.Set(180);
     }
     if (buttons[3].IsPressed)
     {
         direction.Set(270);
     }
     if (buttons.All(b => b.IsPressed == false))
     {
         direction.Set(0);
     }
 }
예제 #2
0
파일: Stick.cs 프로젝트: HablaH/Modul3
 public void Use(int dir, int per)
 {
     direction.Set(dir);
     trigger.Use(per);
 }