Ejemplo n.º 1
0
 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 + ".");
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        void OnDisable()
        {
            PersistentDataManager.UnregisterPersister(this);

            s_Instance = null;
        }