コード例 #1
0
ファイル: DeathPlayer.cs プロジェクト: Kirillkrot322/Game
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag.Equals("Player"))
     {
         Destroy(collision.gameObject);
         deathmenu.LoadDeathScreen();
     }
 }
コード例 #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag.Equals("DeathZone"))
     {
         Destroy(gameObject);
         deathmenu.LoadDeathScreen();
     }
     if (collision.tag.Equals("Coins"))
     {
         /*CoinCollect.coinCount = +1;
          * CoinCollectSave.coin = +1;
          * Destroy(collision.gameObject);*/
         CoinCount       += 1;
         CoinCounter.text = "x" + CoinCount;
         Destroy(collision.gameObject);
         Debug.Log(CoinCount);
     }
     if (collision.tag.Equals("FinishZone"))
     {
         Time.timeScale = 0f;
         finishmenu.LoadWinScreen();
         Destroy(gameObject);
     }
 }