Newer
Older
VolumeRendering_in_Unity / Assets / Scripts / load_setting.cs
using System.Collections;
using System.IO;
using System.Collections.Generic;

using UnityEngine;

[System.Serializable]
public class Setting
{
    public float x_scale;
    public float y_scale;
    public float z_scale;

    public string[] points_str;
}

public class load_setting : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        string data_str = "";
        StreamReader reader;
        Debug.Log(Application.dataPath + "/setting.json");
        reader = new StreamReader(Application.dataPath + "/setting.json");
        data_str = reader.ReadToEnd();
        Setting inputJson = JsonUtility.FromJson<Setting>(data_str);
        Debug.Log(inputJson.x_scale);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}