// Use this for initialization void Start() { m_parentHealth = GetComponentInParent <AIHealth>(); networkedAI = GetComponentInParent <NetworkedAI>(); if (networkedAI != null) { aiType = networkedAI.aiType; } }
// Use this for initialization void Start() { cannonController = GetComponentInChildren <AICannonController>(); networkAI = GetComponentInParent <NetworkedAI>(); if (networkAI != null) { aiType = networkAI.aiType; } else { Debug.LogError("NetworkedAI was unable to be found in parent."); } }
/// <summary> /// Returns an unpurchased FleetShip owned by the client that is ready to be spawned. /// </summary> /// <returns> /// A FleetShip ready to be spawned or null if there aren't any. /// </returns> private FleetShip GetFleetShipToSpawn() { FleetShip temp = null; if (fleetShips != null) { for (int i = 0; i < fleetShips.Length; ++i) { NetworkedAI ai = fleetShips[i].GetComponentInChildren <NetworkedAI>(); FleetAI fleet = fleetShips[i].GetComponentInChildren <FleetAI>(); if (ai != null && fleet != null) { if (!fleet.Purchased) { temp = new FleetShip(ai, fleet); break; } } } } return(temp); }
// Use this for initialization void Start() { cannonController = GetComponentInChildren<AICannonController>(); networkAI = GetComponentInParent<NetworkedAI>(); if (networkAI != null) { aiType = networkAI.aiType; } else { Debug.LogError("NetworkedAI was unable to be found in parent."); } }
public FleetShip(NetworkedAI netAI, FleetAI ai) { networkedAI = netAI; aiShip = ai; }
public FleetShip() { networkedAI = null; aiShip = null; }
//Co-routine for delayed ai respawn IEnumerator RespawnAI(NetworkedAI networkedAI, float timeDelay) { yield return new WaitForSeconds(timeDelay); networkedAI.SetVisible(true, false); }
//Co-routine for delayed ai respawn IEnumerator RespawnAI(NetworkedAI networkedAI, float timeDelay) { yield return(new WaitForSeconds(timeDelay)); networkedAI.SetVisible(true, false); }
// Use this for initialization void Start() { m_parentHealth = GetComponentInParent<AIHealth>(); networkedAI = GetComponentInParent<NetworkedAI>(); if (networkedAI != null) { aiType = networkedAI.aiType; } }