コード例 #1
0
        public void WriteSettingData(InitSettingData mInitSettingData)
        {
            //Test
            string json = JsonUtility.ToJson(mInitSettingData);

            byte[] jsonToBytes = Encoding.ASCII.GetBytes(json);

            File.WriteAllBytes(filePath, jsonToBytes);
        }
コード例 #2
0
        public InitSettingData ReadSettingData()
        {
            InitSettingData mInitSettingData = new InitSettingData();

            byte[] jsonToBytes = File.ReadAllBytes(filePath);

            string json = Encoding.ASCII.GetString(jsonToBytes);

            mInitSettingData = JsonUtility.FromJson <InitSettingData>(json);

            return(mInitSettingData);
        }