private IEnumerator InitState()
        {
            // Set file path.
            string filePath = Application.dataPath + "/" + fileName;

            // Load json text file.
            WWW www = new WWW("file://" + filePath);

            yield return(www);

            // Read json data and convert it to certain format.
            string jsonString = www.text;

            //records = SimpleJson.SimpleJson.DeserializeObject<RecordFormat[]>(jsonString);
            recordData = JsonUtility.FromJson <RecordJsonFormat>(jsonString);

            // Set active state.
            isReplaying = true;
            marker.SetActive(true);

            // Disable EyePoint tracking.
            TobbiManager.Instance.SetSimulationMode(false);

            // Disable Robot movement.
            robotMovement.SetSimulation(false);

            // Set base robot face.
            facialRenderer.Play(facialRenderer.baseFace);
        }
        private void ResetState()
        {
            mainTimer.Reset();
            if (recordData != null && recordData.Length > 0)
            {
                recordData = new RecordJsonFormat();
            }

            marker.SetActive(false);
            currentIndex = 0;

            // Enable EyePoint tracking.
            TobbiManager.Instance.SetSimulationMode(true);

            // Move robot to origin.
            robotMovement.MoveToOrigin();

            // Set base robot face.
            facialRenderer.Play(facialRenderer.baseFace);
        }
 public void ResetState()
 {
     //records = new List<RecordFormat>();
     saveData = new RecordJsonFormat();
     mainTimer.Reset();
 }