Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- public class LoadLevel : MonoBehaviour {
- protected int m_objectiveCount;
- public List<GameObject> ObjectivesList;
- protected List<GameObject> m_EnemyObjectives;
- protected List<GameObject> m_Objectives;
- private void Start()
- {
- m_Objectives = new List<GameObject>(GameObject.FindGameObjectsWithTag("Objective"));
- foreach (GameObject m_Objectives in m_Objectives)
- {
- ObjectivesList.Add(m_Objectives);
- }
- m_EnemyObjectives = new List<GameObject>(GameObject.FindGameObjectsWithTag("Enemy-Objective"));
- foreach (GameObject m_EnemyObjectives in m_EnemyObjectives)
- {
- ObjectivesList.Add(m_EnemyObjectives);
- }
- m_objectiveCount = ObjectivesList.Count;
- }
- public void ListUpdate()
- {
- m_Objectives = new List<GameObject>(GameObject.FindGameObjectsWithTag("Objective"));
- foreach (GameObject m_Objectives in m_Objectives)
- {
- ObjectivesList.Add(m_Objectives);
- }
- m_EnemyObjectives = new List<GameObject>(GameObject.FindGameObjectsWithTag("Enemy-Objective"));
- foreach (GameObject m_EnemyObjectives in m_EnemyObjectives)
- {
- ObjectivesList.Add(m_EnemyObjectives);
- }
- m_objectiveCount = ObjectivesList.Count;
- }
- public void ObjectiveComplete()
- {
- {
- if (m_objectiveCount == 0)
- {
- if (GameObject.Find("AI_Testing") != null)
- {
- SceneManager.LoadSceneAsync("Win");
- }
- }
- else
- {
- Debug.Log("Enemy Down!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment