public Transform redBossTransform; //current transform data of this enemy - DELETE THIS WHEN HAS REAL MODEL private void Start() { playerScript = GameObject.FindWithTag("Player").GetComponent <MoveAround>(); //cache transform data for easy access/performance health = GameObject.FindGameObjectWithTag("redEnemyHealth").GetComponent <redBossHealth>(); enemiesAlive = GameObject.FindGameObjectWithTag("Manager").GetComponent <roundsAndEnemyManager>(); enemiesAlive.aliveCount = 1; BLM = GameObject.FindGameObjectWithTag("mainFloor").GetComponent <BonusLevelManager>(); health.background.guiTexture.enabled = true; GO = GameObject.FindGameObjectWithTag("Manager").GetComponent <GameOver>(); redBossTransform = GameObject.FindGameObjectWithTag("RedBoss").transform; }
private void Start() { LookAtTarget = GameObject.FindWithTag("Player").transform; //target the player InvokeRepeating("PickRandomNumber", 1.0f, 1.0f); InvokeRepeating("PickRandomNumber", 1.0f, 3.0f); enemiesAlive = GameObject.FindGameObjectWithTag("Manager").GetComponent <roundsAndEnemyManager>(); enemiesAlive.aliveCount = 1; hitCoolDownDefault = hitCoolDown; health = GameObject.FindGameObjectWithTag("redEnemyHealth").GetComponent <redBossHealth>(); gt = health.GetComponent(typeof(GUITexture)) as GUITexture; gt.enabled = true; //healthBackground = GameObject.FindGameObjectWithTag("redEnemyHealthBack").GetComponent(typeof(GUITexture)) as GUITexture; healthBackground = health.background.GetComponent(typeof(GUITexture)) as GUITexture; healthBackground.enabled = true; }