Week Two - Begin implementing an editor tool
Introduction
After the first week of establishing a basic understanding on editor tools in unity as well as choosing the sprite processor solution to try and adopt, the second week would have myself attempt to implement my own iteration of a unity editor tool to show case my code contributions in the 'SGD300 Spike' collection.
Goals
- Adopt the sprite processor solution from the 'Tutorial - Creating Basic Editor Tools' source to show case my code contributions from the 'SGD300 Spike' collection.
Personnel
Primary - Zackery Camille [1095725]
Secondary - Christian
Technologies, Tools, and Resources used
What was found out?
The follower exert of code depicts the 'SpriteProcessor' script from the 'Tutorial - Creating Basic Editor Tools' source.
using UnityEngine; using System.Collections; using UnityEditor; public class SpriteProcessor : AssetPostprocessor { void OnPostprocessTexture(Texture2D texture) { string lowerCaseAssetPath = assetPath.ToLower(); bool isInSpritesDirectory = lowerCaseAssetPath.IndexOf("/sprites/") != -1; if (isInSpritesDirectory) { TextureImporter textureImporter = (TextureImporter)assetImporter; textureImporter.textureType = TextureImporterType.Sprite; } } }
When trying to adopt the sprite processor I thought to take a more deeper look at the code. Upon looking at the 'Assetprocessor' class that is called in the 'SpriteProcessor' script I began to realise that the sprite processor solution from the 'Tutorial - Creating Basic Editor Tools' source is able to work so simplistically because of the 'Assetprocessor' class. When reading through the class I was able to understand that this class would be incompatible with csv or json files and so it is a class and a solution that I will be unable to adopt for my portfolio.
For more information regarding the 'Assetprocessor' class please refer to the 'AssetPostprocessor' source in the Technologies, Tools, and Resources used section.
With the conclusion that the sprite processor solution would not work for me I went back to the 'Tutorial - Creating Basic Editor Tools' source and came to the realisation that a ScriptableWizard editor tool would be far more suited for what I wish to accomplish with this task.
Solution Justification
The drag and drop solution was quite naive of myself to consider in the first place as there could be differing data sizes or data structures between several csv files. Too many for a simple drag and drop process to be able to handle all the possible variations. A ScriptableWizard tool would be more competent of a solution to discern through possible variations.
Get SGD300 Unity Editor tools
SGD300 Unity Editor tools
Status | Released |
Category | Tool |
Author | Duck Pond Studios |
More posts
- Week One - Research into Unity editor toolsOct 25, 2019
- Week Three - Implement a ScriptableWizard editor toolOct 25, 2019
Leave a comment
Log in with itch.io to leave a comment.