public ICarrier GetCarrier() { if (carrier == null || carrier.Equals(null) || carrier.GetIsDead()) { return(null); } return(carrier); }
public ICarrier GetCarrier() { if (!SectorManager.instance || SectorManager.instance.current.type != Sector.SectorType.BattleZone) { return(null); } if ((carrier == null || carrier.Equals(null) || carrier.GetIsDead()) && SectorManager.instance.carriers.ContainsKey(faction)) { carrier = SectorManager.instance.carriers[faction]; if (carrier == null || carrier.Equals(null) || carrier.GetIsDead()) { carrier = null; } } return(carrier); }
protected override void Start() { if ((carrier != null && !carrier.Equals(null)) && carrier.GetIsInitialized()) { spawnPoint = carrier.GetSpawnPoint(); } transform.position = spawnPoint; // initialize instance fields base.Start(); // base start ai = GetAI(); if (ai && ai.getMode() == AirCraftAI.AIMode.Inactive) { if (sectorMngr.current.type == Sector.SectorType.BattleZone) { ai.setMode(AirCraftAI.AIMode.Battle); } else { ai.setMode(AirCraftAI.AIMode.Inactive); } ai.allowRetreat = true; } }