void OnEnable() { instance = (UnityFileDebug)target; absolutePathContent = new GUIContent { text = "Absolute Path", tooltip = "The absolute system path to store the outputted log files" }; fileNameContent = new GUIContent { text = "Export File Name", tooltip = "The filename (without extension) you would like to save logs as" }; fileTypeContent = new GUIContent { text = "Export File Type", tooltip = "Export file type" }; // Update references to serialized objects showAbsolute = serializedObject.FindProperty("useAbsolutePath"); absolutePath = serializedObject.FindProperty("absolutePath"); fileName = serializedObject.FindProperty("fileName"); filePath = serializedObject.FindProperty("filePath"); filePathFull = serializedObject.FindProperty("filePathFull"); fileType = serializedObject.FindProperty("fileType"); }
public void Start() { instance = this; string filePath = Application.persistentDataPath + "/testFile.txt"; StreamWriter sr = File.CreateText(filePath); sr.WriteLine("This is my file."); sr.WriteLine("I can write ints {0} or floats {1}, and so on.", 1, 4.2); sr.Close(); }
void OnEnable() { instance = (UnityFileDebug)target; absolutePathContent = new GUIContent(); absolutePathContent.text = "Absolute Path"; absolutePathContent.tooltip = "The absolute system path to store the outputted json logfiles"; fileNameContent = new GUIContent(); fileNameContent.text = "File Name"; fileNameContent.tooltip = "The filename (without extension) you would like to save logs as"; logTimeContent = new GUIContent(); logTimeContent.text = "Log Time"; logTimeContent.tooltip = "Log the time out with each event?"; // Update references to serialized objects showAbsolute = serializedObject.FindProperty("useAbsolutePath"); absolutePath = serializedObject.FindProperty("absolutePath"); fileName = serializedObject.FindProperty("fileName"); filePath = serializedObject.FindProperty("filePath"); filePathFull = serializedObject.FindProperty("filePathFull"); logTime = serializedObject.FindProperty("logTime"); }