protected override void Awake()
        {
            base.Awake ();

            #if UNITY_EDITOR
            PlayerSettings.bundleVersion = buildVersion;

            // set db
            // The example does not use the auto-generation db and table(DDL).
            Sqlite sql = new Sqlite ();
            if (sql.CreateFile ("hellgate.db")) {
                sql.CreateTable ("hellgate.db", new Board ().GetType ());
                sql.CreateTable ("hellgate.db", new Comment ().GetType ());
            }

            //        if (sql.CreateFile ("Hellgate.db")) {
            //            sql.ExecuteNonQuery ("CREATE TABLE `board` ( " +
            //            "`idx` INTEGER PRIMARY KEY AUTOINCREMENT, " +
            //            "`name` TEXT, " +
            //            "`description` TEXT " +
            //            ");");
            //        }
            #endif

            // add BGM
            SoundManager.Instance.AddBGM (bgm);
            SoundManager.Instance.PlayBGM ();
        }
Example #2
0
 /// <summary>
 /// Resets the DB.
 /// </summary>
 public void ResetDB()
 {
     sqlite = new Sqlite(dbName, true);
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Hellgate.Query"/> class.
 /// </summary>
 /// <param name="db">Database name && path.</param>
 public Query(string db)
 {
     dbName = db;
     sqlite = new Sqlite (db);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Hellgate.Query"/> class.
 /// </summary>
 /// <param name="db">Database name && path.</param>
 public Query(string db)
 {
     dbName = db;
     sqlite = new Sqlite(db);
 }
Example #5
0
 /// <summary>
 /// Resets the DB.
 /// </summary>
 public void ResetDB()
 {
     sqlite = new Sqlite (dbName, true);
 }