// Use this for initialization void Start() { m_shipScript = GetComponent <AIShipScript>(); switch (behaviour) { case Behaviour.Civilian: case Behaviour.Cargo: case Behaviour.Cop: enemies = new string[2] { "CriminalShip", "CriminalLeader" }; friends = new string[3] { "Player Ship", "CargoShip", "CopShip" }; break; case Behaviour.Grunt: case Behaviour.Leader: enemies = new string[3] { "Player Ship", "CargoShip", "CopShip" }; friends = new string[2] { "CriminalShip", "CriminalLeader" }; break; } }
// Use this for initialization void Start() { m_shipScript = GetComponent<AIShipScript>(); switch (behaviour) { case Behaviour.Civilian: case Behaviour.Cargo: case Behaviour.Cop: enemies = new string[2]{ "CriminalShip", "CriminalLeader" }; friends = new string[3]{"Player Ship", "CargoShip", "CopShip"}; break; case Behaviour.Grunt: case Behaviour.Leader: enemies = new string[3]{ "Player Ship", "CargoShip", "CopShip" }; friends = new string[2]{ "CriminalShip", "CriminalLeader" }; break; } }
// Use this for initialization void Start() { m_shipScript = GetComponent<AIShipScript>(); chaseTime = 0.0f; }
private float chaseTime; // how long will an enemy chase // Use this for initialization void Start() { m_shipScript = GetComponent <AIShipScript>(); chaseTime = 0.0f; }
// Use this for initialization void Start() { m_shipScript = GetComponent<AIShipScript>(); switch (behaviour) { case Behaviour.Civilian: case Behaviour.Cargo: case Behaviour.Cop: case Behaviour.Rescue: m_shipScript.enemies = new string[2]{ "CriminalShip", "CriminalLeader" }; m_shipScript.friends = new string[5]{"Player Ship", "CargoShip", "CopShip", "RescueShip", "Mom"}; break; case Behaviour.Grunt: case Behaviour.Leader: case Behaviour.Turret: m_shipScript.enemies = new string[5]{ "Player Ship", "CargoShip", "CopShip", "RescueShip", "Mom"}; m_shipScript.friends = new string[2]{ "CriminalShip", "CriminalLeader" }; break; } // For special objects which won't be spawned through AISpawners switch (GetComponent<ShipBehaviourScript>().behaviour) { case ShipBehaviourScript.Behaviour.Turret: AIShipScript ss = GetComponent<AIShipScript>(); ss.InitWeapons(); WeaponScript.WeaponType weapon = (WeaponScript.WeaponType) Random.Range(0, (int)WeaponScript.WeaponType.SCATTER_SHOT + 1); ss.WeaponSlots[ 0 ].SetWeapon( Instantiate( GameMaster.WeaponMngr.GetWeaponPrefab( weapon ) ) ); break; } }