// Register the input pausable object to have its OnPause/OnResume methods called public void Register(IPausable pausable) { // Register the input pausable to be executed for every pausble event foreach (BroadcastType bt in BroadcastType.GetValues(typeof(BroadcastType))) { pausableDict[bt].Add(pausable); } }
// Start is called before the first frame update void Awake() { if (primaryInstance == null) { primaryInstance = this; } else { Debug.LogWarning("Primary instance already assigned. Something probably went wrong"); } // Create a hashset for each type of broadcast // so fugly foreach (BroadcastType bt in BroadcastType.GetValues(typeof(BroadcastType))) { pausableDict.Add(bt, new HashSet <IPausable>()); } }