// Start is called before the first frame update void Start() { pointToGo = GameObject.Find("BossSpawnPoint").transform; _healthObject = GameObject.Find("Canvas").transform.Find("BossHealthBar").gameObject; _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <spawnManager>(); _curRound = _spawnManager.CurRound(); _maxHealth *= _curRound; _curHealth = _maxHealth; _healthObject.GetComponent <Image>().fillAmount = _curHealth / _maxHealth; }
// Start is called before the first frame update void Start() { _player = GameObject.Find("Player").GetComponent <Player>(); _Animator = gameObject.GetComponent <Animator>(); _collider2D = GetComponent <Collider2D>(); _audioSource = GetComponent <AudioSource>(); _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <spawnManager>(); _centerLine = transform.position.x; _shieldObj = transform.Find("Shields").gameObject; _shieldObj.SetActive(false); float _shieldRandom = UnityEngine.Random.Range(0f, 100.0f); if (_shieldChancePercent >= _shieldRandom) { _shieldObj.SetActive(true); _shields = 1; } float _smartRandom = UnityEngine.Random.Range(0f, 100.0f); if (_smartEnemyPercent >= _smartRandom) { _smartEnemy = true; } if (_player == null) { Debug.LogError("Player is NULL"); } if (_Animator == null) { Debug.LogError("Animator is NULL"); } if (_spawnManager == null) { Debug.LogError("Spawn_Manager is NULL"); } if (_collider2D == null) { Debug.LogError("Collider2D is NULL"); } if (_audioSource == null) { Debug.LogError("AudioSource is NULL"); } _curWave = _spawnManager.CurWave() * _spawnManager.CurRound(); StartCoroutine(ShootEnemyLaser()); }