// starts playing public bool StartPlaying() { if (isPlaying) { return(false); } isPlaying = true; inicializado = true; //para terminar de leer la misma frase move_finished = false; if (!_vista_previa && !_Movimiento_registrado_play) { // Movimientos Gesture_Action movimiento = Gesture_Action.Instance; movimiento.LeerMovimiento(filePath); movimiento.Comparar = true; } // avoid recording an playing at the same time if (isRecording && isPlaying) { isRecording = false; Debug.Log("Recording stopped."); } // stop playing if there is no file name specified //if(filePath.Length == 0 || !File.Exists(filePath)) //{ // isPlaying = false; // Debug.LogError("No file to play."); // if(infoText != null) // { // infoText.text = "No file to play."; // } //} if (isPlaying) { Debug.Log("Playing started."); if (infoText != null) { infoText.text = "Playing... Say 'Stop' to stop the player."; } // initialize times fStartTime = fCurrentTime = Time.time; fCurrentFrame = -1; // open the file and read a line #if !UNITY_WSA TextAsset asset = Resources.Load("movimientos/" + filePath) as TextAsset; // convert string to stream byte[] byteArray = Encoding.UTF8.GetBytes(asset.text); //byte[] byteArray = Encoding.ASCII.GetBytes(contents); MemoryStream stream = new MemoryStream(byteArray); // convert stream to string fileReader = new StreamReader(stream); #endif ReadLineFromFile(); // enable the play mode if (manager) { manager.maxTrackedUsers = 2; if (_registro_comparacion) { //para reproducir el movimiento con el usuario a la vez para ver errores manager.EnablePlayMode(true); _registro_comparacion = false; } else { // para reproducir la grabacion y usuario captado con la kinect manager.EnableCompareMode(true); } } } return(isPlaying); }