Пример #1
0
    private void LoadJsonFile(DebugHolder debugHolder)
    {
        string     currentFile = File.ReadAllText(debugHolder.jsonFile);
        DataHolder currentData = JsonUtility.FromJson <DataHolder>(currentFile);

        debugHolder.dataHolder = currentData;
    }
Пример #2
0
    private void CreateSingleLine(DebugHolder debugHolder)
    {
        GameObject gameObject = Instantiate(debugLinePrefab);
        DebugLine  line       = gameObject.GetComponent <DebugLine>();

        if (line != null)
        {
            line.Create(debugHolder.dataHolder);
            debugHolder.debugLine = line;
        }
    }
Пример #3
0
    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];
    }
Пример #4
0
 private void SelectData(int index)
 {
     currentDebugHolder = debugHolders[index];
 }