// Update is called once per frame void Update() { if (activo && Input.GetKeyUp(KeyCode.A)) { //Debug.Log("Creando Nuevo Usuario"); db.InsertarUsuario(CodSer); } if (activo && Input.GetKeyUp(KeyCode.S)) { //Debug.Log("Buscando Usuario"); db.BuscarUsuario(CodSer); } if (activo && Input.GetKeyUp(KeyCode.F)) { //Debug.Log("Aniadir elemento a lista Usuario"); db.ActualizarUsuario(CodSer, "ANADIDO"); HP = db.ObtenerLongitudLista(CodSer); } if (activo && Input.GetKeyUp(KeyCode.G)) { //Debug.Log("Borrar elemento a lista Usuario"); db.BorrarListaUsuario(CodSer, "BORRADO"); HP = db.ObtenerLongitudLista(CodSer); } if (activo && Input.GetKeyUp(KeyCode.D)) { //Debug.Log("Borrando Usuario"); db.BorrarUsuario(CodSer); } if (activo && Input.GetKeyUp("space")) { activo = false; Debug.Log("CODSER: " + CodSer + " going DARK"); } }
// Use this for initialization void Start() { color = LayerMask.LayerToName(this.gameObject.layer); System.Random random = new System.Random(); int randomNumber = random.Next(0, 4096); CodSer = "UNITY_" + randomNumber; activo = false; HP = 3; size = 0.05f; //Debug.Log("CODSER: "+CodSer+" esta ahora activo"); db = new DB_Script(); db.Init(); //Debug.Log("Creando Nuevo Usuario"); db.InsertarUsuario(CodSer); db.ActualizarColorUsuario(CodSer, color); for (int i = 1; i < HP; i++) { db.AniadirListaUsuario(CodSer, "CREADO"); } //db.AniadirImagenUsuario(CodSer); string dateToday = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"); Debug.Log("FECHA " + dateToday); }