void CaptureComplete(object sender, EventArgs e) { if ((!captureVideo) && (!captureParams)) { return; } if ((eventIndex != -1) && (inputFile != string.Empty)) { string fullPath = Path.GetFullPath(Application.dataPath + inputFile); if (File.Exists(fullPath + ".py")) { string[] args = new string[] { fullPath.Remove(fullPath.LastIndexOf('/') + 1), inputFile.Substring(inputFile.LastIndexOf('/') + 1), eventIndex.ToString(), PlayerPrefs.GetString("Listener Port") }; string result = Marshal.PtrToStringAuto(CommunicationsBridge.PythonCall( Application.dataPath + "/Externals/python/", "auto_event_script", "send_next_event_to_port", args, args.Length)); eventIndex = Convert.ToInt32(result); } else { Debug.Log(string.Format("File {0} does not exist!", Path.GetFullPath(Application.dataPath + inputFile))); } } else { EnableObjects(); GameObject.Find("VoxWorld").GetComponent<ObjectSelector>().SendMessage("ResetScene"); } }
void StartAutoInput(object sender, EventArgs e) { if (inputFile != string.Empty) { string fullPath = Path.GetFullPath(Application.dataPath + inputFile); if (File.Exists(fullPath + ".py")) { string[] args = new string[] { fullPath.Remove(fullPath.LastIndexOf('/') + 1), inputFile.Substring(inputFile.LastIndexOf('/') + 1), eventIndex.ToString(), PlayerPrefs.GetString("Listener Port") }; string result = Marshal.PtrToStringAuto(CommunicationsBridge.PythonCall( Application.dataPath + "/Externals/python/", "auto_event_script", "send_next_event_to_port", args, args.Length)); eventIndex = Convert.ToInt32(result); } else { Debug.Log(string.Format("File {0} does not exist!", Path.GetFullPath(Application.dataPath + inputFile))); } } }