using System.Collections; using System.Collections.Generic; using UnityEngine; public class LevelStatus : MonoBehaviour { public int enemiesHit; public int enemiesMissed; public int totalEnemies = 30; bool Invaded = false; public int remainingEnemies; public GameObject GameOverObject; public GameObject LevelCompleteObject; // [SerializeField] private GameManager gameManager; // Start is called before the first frame update void Start() { // gameManager = GameObject.Find("Game Manager").GetComponent(); totalEnemies = remainingEnemies; } // Update is called once per frame void Update() { // Debug.Log("Enemies Hit " + enemiesHit); // Debug.Log("Enemies Missed " + enemiesMissed); Debug.Log("Enemy Total " + totalEnemies); Debug.Log("remaining Enemies: " + remainingEnemies); } public void LevelFailed() { { GameOverObject.SetActive(true); } } public void LevelComplete() { { LevelCompleteObject.SetActive(true); } } public void UpdateTotal() { remainingEnemies--; Debug.Log("remaining Enemies: " + remainingEnemies); if(remainingEnemies < 1 && Invaded == false) { LevelComplete(); } if(enemiesMissed > 15) { Invaded = true; LevelFailed(); LevelCompleteObject.SetActive(false); } } //!When player hits an enemy add to count //!when count reaches 0 levelComplete //if too many enemies missed trigger levelfailed //limit amount of enemies to spawn //visual representation of enemies landed //!total Enemies delclares value //!set total enemies = to remaining Enemies on level Start //!when an enemy is missed it subtracts from remaining enemies //!when an enemy is hit it subtracts from remaining enemies //player fails automatically when set number of enemies are missed //!when total enemies is = to 0 player completes level/Unless Enemies Missed Reaches Trigger //code needs to know to not trigger a win if the enemies reach their threshhold }