SGD300 Unity Editor tools
A downloadable tool
SGD300 Unity editor tools
The following project page is a portfolio piece of my contributed work from the 'SGD300 Spikes' collection. The 'SGD300 Spikes' collection was a group project involving my entire class working together to recreate our own iteration of the RPG Dungeon Siege video game. I have reflected my contribution to the group project by creating editor tools in the unity engine that handles the CSV to JSON conversion process for display in this portfolio.
To read how I went during this task you can read the dev logs below that span over three weeks to find out.
The following video highlights the editor tools that I created in action.
The following code extracts depict the commands listed inside of the OnWizardCreate() method from the ScriptableWizard class for generating the json file and reading the json file. This is the method for each script respectively responsible for executing the editor tool.
Generate json file
//When the button is pressed it executes the following within. private void OnWizardCreate() { // Spilts the csv file into a 2D array "csvGrid". csvGrid = SplitCSVGrid(selectCSV.ToString()); // Path that it will save the new json file. string path = "Assets/Zackery/Scripts/itemJSONSW.json"; // Generate json string to be added to new json file. string str = JsonUtility.ToJson(GenerateJson()); using (FileStream fs = new FileStream(path, FileMode.Create)) { using (StreamWriter writer = new StreamWriter(fs)) { writer.Write(str); } }
Read json file
//When the button is pressed it executes the following within. private void OnWizardCreate() { //Find json - NOTE: change to match file location. itemPath = Application.dataPath + "/Zackery/Scripts/itemJSONSW.json"; //Reads all item json Data. itemJsonString = File.ReadAllText(itemPath); //Create array from Json. ItemCollection[] itemList = JSONHelper.FromJson<ItemCollection>(itemJsonString); allItems = itemList; Debug.Log(itemJsonString); }
If you would like to see more from the scripts feel free to download the project or clone the respositry via the following link.
git clone https://Zackery_Camille@bitbucket.org/Zackery_Camille/zackery_camille_sgd300_tas...
Status | Released |
Category | Tool |
Author | Duck Pond Studios |
Download
Development log
- Week One - Research into Unity editor toolsOct 25, 2019
- Week Two - Begin implementing an editor toolOct 25, 2019
- Week Three - Implement a ScriptableWizard editor toolOct 25, 2019
Leave a comment
Log in with itch.io to leave a comment.