Exemplo n.º 1
0
        public void Awake(DBConfig dbConfig)
        {
            string connectionString = dbConfig.ConnectionString;

            mongoClient = new MongoClient(connectionString);
            database    = mongoClient.GetDatabase(dbConfig.DBName);

            Transfers.Clear();
            foreach (Type type in Game.EventSystem.GetAllType())
            {
                if (type == typeof(IDBCollection))
                {
                    continue;
                }
                if (!typeof(IDBCollection).IsAssignableFrom(type))
                {
                    continue;
                }
                Transfers.Add(type.Name);
            }

            Instance = this;
        }
Exemplo n.º 2
0
 public void Destory()
 {
     Instance = null;
     Transfers.Clear();
 }