private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.CompareTag("Player")) { boss.Activate(); } }
IEnumerator SpawnBoss() { Transform spawnTile = map.GetRandomOpenTile(); Boss boss = Instantiate(bossMan, spawnTile.position + Vector3.up * bossMan.transform.localScale.y, Quaternion.identity) as Boss; Color skinColor = boss.GetComponent <Renderer>().material.color; boss.deathEffect.GetComponent <Renderer>().sharedMaterial.color = skinColor; boss.OnDeath += OnBossDeath; yield return(null); boss.Activate(); }
public void ActivateRoom() { if (boss != null) { boss.Activate(this); ActionsController.Instance.SendOnBossActivate(); return; } for (int i = 0; i < spawnedEnemies.Count; i++) { if (spawnedEnemies[i] != null) { spawnedEnemies[i].Activate(this); } } }