Kizspy | Question: 43
(Choose 1 answer)
What does this script do?
using UnityEngine;
public class GameController: MonoBehaviour {
public static GameController Instance { get; private set; }
public delegate void OnPause();
public event OnPause PauseEvent;
void Awake() {
if (Instance == null) {
Instance = this;
DontDestroyOnLoad(gameObject);
} else {
}
Destroy(gameObject);
void Update() {
if (Input.GetKeyDown(KeyCode.P)) {
PauseEvent?.Invoke();
A. Moves the GameObject on pause
B. Triggers a pause event when the P key is pressed
C. Changes the GameObject's material
D. Logs the pause state