Exemple #1
0
    private dbConection conectarDB()
    {
        _connector = new dbConection ();
        string folderPath;

        if(Application.platform == RuntimePlatform.Android){
            folderPath = Application.persistentDataPath+"/DB";
        }else{
            folderPath = "Assets/DB";
        }
        URIDataBase = folderPath + "/" + databaseName;
        if(!File.Exists(URIDataBase)){
            System.IO.Directory.CreateDirectory(folderPath);
            string path = "jar:file://"+folderPath+"!/assets/"+databaseName;
            WWW loadDB = new WWW(path);
            while(!loadDB.isDone){
            }
            File.WriteAllBytes(URIDataBase,loadDB.bytes);
            _connector.OpenDB("URI=file:"+URIDataBase);
            _connector.CrearTabla(tablaPosicion);
            _connector.CrearTablaMonstruos(tablaMonstruos);
            _connector.InsertData("Sc01","0","0");
        }else{
            _connector.OpenDB("URI=file:"+URIDataBase);
        }
        return _connector;
    }
Exemple #2
0
 public void updateMonsters()
 {
     _connector = conectarDB();
     _connector.InsertMonsters();
     _connector.SelectMonsterTable();
     _connector.CloseDB();
 }
Exemple #3
0
 public void updatePosition(string scene,string posx,string posy)
 {
     _connector = conectarDB ();
     _connector.UpdateData (scene,posx,posy);
     _connector.SelectData ();
     _connector.CloseDB ();
 }
Exemple #4
0
 public void cargarPartida()
 {
     _connector = conectarDB ();
     _connector.SelectData ();
     _connector.SelectMonsterTable();
     _connector.CloseDB ();
     Application.LoadLevel(PlayerPrefs.GetString("Scene"));
     PlayerPrefs.DeleteKey("Scene");
 }