//============================================================================================================================================================== void Start() { GameObject gameControllerObject = GameObject.FindGameObjectWithTag("gameControllerEnemy"); control = gameControllerObject.GetComponent <gameControllerModeEnemies> (); //respawn ();//spawn enemies }
//=========================================================================================================================================== void Update() { float probabilty = Time.deltaTime * shotspersecond; if (Random.value < probabilty) { fire(); } // prevent the el bullets of enemy become st.line && create time between each bullet if (controller == null) //we need the object controller to find the object in the game that hold the class that we want no access in. { controller = GameObject.Find("gameController").GetComponent <gameControllerModeEnemies> (); } }
//================================================================================================================================================ void Start() { //we need the object controller to find the object in the game that hold the class that we want no access in. controller = GameObject.Find("gameController").GetComponent <gameControllerModeEnemies> (); }
//========================================================================================================================== void Start() { //make an object to hold the class from other object in the game to can access it. GameObject gameControllerObject = GameObject.FindGameObjectWithTag("gameControllerEnemy"); control = gameControllerObject.GetComponent <gameControllerModeEnemies> (); }