Esempio n. 1
0
 void EnableModulesForSeat(ShipSeat seat)
 {
     if (seat.role == ShipSeatRole.pilot && seat.controlledModules.Count < 1) // if pilot has no pilot module
     {
         Debug.LogWarning("Attempting to pilot ship without a pilot module");
         // !!! TODO error handling here? instantiate a module?
     }
     SetModuleEnabledStaes(seat.controlledModules, true);
 }
Esempio n. 2
0
 void InitializeSeatModules(ShipSeat seat)
 {
     for (int i = seat.controlledModules.Count - 1; i >= 0; i--)
     {
         if (seat.controlledModules[i] == null)
         {
             seat.controlledModules.RemoveAt(i);
         }
         seat.controlledModules[i].InitializeModule(this);
     }
 }
Esempio n. 3
0
    // !!! TODO different handling for controlled players vs uncontrolled
    void Embark(Character character)
    {
        ShipSeat playerSeat = HighestPriorityAvailableSeat;

        playerSeat.occupant = character;

        shipController.enabled = true;
        EnableModulesForSeat(playerSeat);
        character.ToggleControl();

        availableSeats--;
    }
Esempio n. 4
0
 void DisableModulesForSeat(ShipSeat seat)
 {
     SetModuleEnabledStaes(seat.controlledModules, false);
 }