// Start is called before the first frame update void Start() { if (!Instance) { Instance = this; } Debug.Log("New Boss"); if (bossWalls) { bossWalls.SetActive(false); } healthBar = GameObject.Find("BossHealthBar").GetComponent <Image>(); bossEnabled = false; maxHealth = thisRoomsBoss.maxHealth; bossRB = thisRoomsBoss.GetComponent <Rigidbody2D>(); bossRB.bodyType = RigidbodyType2D.Static; if (defeatEvent) { if (GameManagerScript.Instance.occuredEvents.Contains(defeatEvent.eventName)) { if (defeatedWalls) { defeatedWalls.SetActive(true); } thisRoomsBoss.gameObject.SetActive(false); } else { if (defeatedWalls) { defeatedWalls.SetActive(false); } thisRoomsBoss.gameObject.SetActive(true); } } }
private void OnDestroy() { Instance = null; }