private void LoadJsonFile(DebugHolder debugHolder) { string currentFile = File.ReadAllText(debugHolder.jsonFile); DataHolder currentData = JsonUtility.FromJson <DataHolder>(currentFile); debugHolder.dataHolder = currentData; }
private void CreateSingleLine(DebugHolder debugHolder) { GameObject gameObject = Instantiate(debugLinePrefab); DebugLine line = gameObject.GetComponent <DebugLine>(); if (line != null) { line.Create(debugHolder.dataHolder); debugHolder.debugLine = line; } }
private void GetDebugFiles() { string jsonPath = EditorUtility.OpenFolderPanel("Choose DebugDeta Path", Application.dataPath, ""); //Only add the files that end with .json string[] dataFiles = Directory.GetFiles(jsonPath); int nameIndex = 0; for (int i = 0; i < dataFiles.Length; i++) { if (dataFiles[i].EndsWith(".json")) { currentDebugHolder = new DebugHolder(); currentDebugHolder.jsonFile = dataFiles[i]; string dataName = "Data" + nameIndex; currentDebugHolder.popupIndex = nameIndex; currentDebugHolder.dataName = dataName; dataNames.Add(dataName); debugHolders.Add(currentDebugHolder); nameIndex++; } } currentDebugHolder = debugHolders[0]; }
private void SelectData(int index) { currentDebugHolder = debugHolders[index]; }