// Update is called once per frame
    void FixedUpdate()
    {
        //maxHealth = GameController.instance.getCurrentHealth();

        if (pilot != null)
        {
            moveCon.MoveShip(pilot.GetComponent <PlayerInputContainer>());
        }
        if (gunner != null)
        {
            weapCon.TryShoot(gunner.GetComponent <PlayerInputContainer>());
            weapCon.MoveReticle(gunner.GetComponent <PlayerInputContainer>());
        }
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     if (pilot != null && GameController.instance.State == (int)GameController.GameStates.FREEROAM)
     {
         moveCon.MoveShip(pilot.GetComponent <PlayerInputContainer>());
     }
     if (gunner != null && GameController.instance.State == (int)GameController.GameStates.FREEROAM)
     {
         weapCon.TryShoot(gunner.GetComponent <PlayerInputContainer>());
         weapCon.MoveReticle(gunner.GetComponent <PlayerInputContainer>());
     }
     if (fixer != null && GameController.instance.State == (int)GameController.GameStates.FREEROAM)
     {
         repairCon.TryRepair(fixer.GetComponent <PlayerInputContainer>());
     }
 }