コード例 #1
0
 // 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);
         }
     }
 }
コード例 #2
0
 private void OnDestroy()
 {
     Instance = null;
 }