Added AI code for enemies utilizing State Management Created simple enemy prefab with the AI
26 lines
628 B
C#
26 lines
628 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace Assets.Scripts.Runtime.GameManagement {
|
|
public class GameManager : MonoBehaviour {
|
|
public static bool IsPaused { get; private set; }
|
|
[SerializeField] private GameObject pauseMenuUI;
|
|
|
|
void Update() {
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
TogglePause();
|
|
}
|
|
|
|
public void TogglePause() {
|
|
IsPaused = !IsPaused;
|
|
Time.timeScale = IsPaused ? 0f : 1f;
|
|
AudioListener.pause = IsPaused;
|
|
pauseMenuUI.SetActive(IsPaused);
|
|
}
|
|
}
|
|
}
|