Ejemplo n.º 1
0
        public StateMachineHostBuilder SetPersistence(PersistenceLevel persistenceLevel, IStorageProvider storageProvider)
        {
            if (persistenceLevel < PersistenceLevel.None || persistenceLevel > PersistenceLevel.ExecutableAction)
            {
                throw new InvalidEnumArgumentException(nameof(persistenceLevel), (int)persistenceLevel, typeof(PersistenceLevel));
            }

            _persistenceLevel = persistenceLevel;
            _storageProvider  = storageProvider ?? throw new ArgumentNullException(nameof(storageProvider));

            return(this);
        }
Ejemplo n.º 2
0
 void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }