// Use this for initialization void Start() { PoliceCarScript pcs = this.GetComponentInParent <PoliceCarScript> (); if (pcs.swat == true) { this.GetComponent <SpriteRenderer> ().sprite = policeVan; } Destroy(this); }
bool areAllSwatSpawned() { foreach (GameObject g in copCarsInWorld) { PoliceCarScript pcs = g.GetComponent <PoliceCarScript> (); if (pcs.swat == true && pcs.spawnedCops == false) { return(false); } } return(true); }