Advertisement
sphinx2001

CheckWin.cs

Feb 5th, 2021
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.SceneManagement;
  5. public class CheckWin : MonoBehaviour
  6. {
  7.    
  8.     void Update()
  9.     {
  10.         if(GameSystem.MonsterCount == 0 && GameSystem.HP > 0)
  11.         {
  12.             GameObject[] enemis = GameObject.FindGameObjectsWithTag("Enemy");
  13.             if(enemis.Length == 0)
  14.             {
  15.                 SceneManager.LoadScene("WinLevel");
  16.             }
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement