void Awake() { if (s_Instance == null) { s_Instance = this; } else { throw new UnityException("There cannot be more than one PlayerInput script. The instances are " + s_Instance.name + " and " + name + "."); } }
void OnEnable() { if (s_Instance == null) { s_Instance = this; } else if (s_Instance != this) { throw new UnityException("There cannot be more than one PlayerInput script. The instances are " + s_Instance.name + " and " + name + "."); } PersistentDataManager.RegisterPersister(this); }
void OnDisable() { PersistentDataManager.UnregisterPersister(this); s_Instance = null; }