Exemplo n.º 1
0
 void Attack(int weaponselected)
 {
     if (Target)
     {
         if (weaponselected == 2)
         {
             if (targetState == TargetState.IsLocked)
             {
                 flight.LaunchMissile();
             }
         }
         else
         {
             flight.ShootMiniGun();
         }
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (!Target)
        {
            FindTarget();
        }
        Pitch    = Input.GetAxis("Pitch");
        Roll     = Input.GetAxis("Roll");
        Throttle = Input.GetAxis("Throttle");
        Yaw      = Input.GetAxis("Yaw");
        plane.Move(Pitch: Pitch, Roll: Roll, Yaw: Yaw, Throttle: Throttle);

        if (Input.GetKey(KeyCode.LeftControl))
        {
            plane.ShootMiniGun();
        }
        if (Input.GetKeyDown(KeyCode.Space))
        {
            plane.LaunchMissile();
        }
    }