# MGS.FileAvatar **Repository Path**: Mogoson/MGS.FileAvatar ## Basic Information - **Project Name**: MGS.FileAvatar - **Description**: Avatar for text file to read and write data. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-07-22 - **Last Updated**: 2022-12-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MGS.FileAvatar ## Summary - Avatar for text file to read and write data. ## Environment - Unity 5.3 or above. - .Net Framework 3.5 or above. ## Platform - Windows. ## Demand - Read Json file to structure data, modify and write data to text file. - Read key value lines file to dictionary data, modify and write data to text file. ## Design - FileAvatar class to read and write text file content. - JsonFileAvatar class inherit from FileAvatar to serialize content to structure data. - KeyFileAvatar class inherit from FileAvatar to convert content to dictionary data. ## Usage ```C# //Key Value Line file. var avatar = new KeyFileAvatar(file);//Auto pull content form file. var value = avatar.GetValue(key); avatar.SetValue(key, value);//Commit to cache. avatar.Push();//Write content to local file. //Json file. var avatar = new JsonFileAvatar(file);//Auto pull content form file. var info = avatar.Content; info.tittle = "Tittle"; avatar.Commit(info);//Commit to cache. avatar.Push();//Write content to local file. ``` ## Demo - Demos in the path "MGS.Packages/FileAvatar/Demo/" provide reference to you. ------ Copyright © 2022 Mogoson. mogoson@outlook.com