-
-
Save toxicFork/097df5144fd824647404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[SerializeField] private TextAsset xmlAsset; | |
public SpriteAlignment spriteAlignment = SpriteAlignment.Center; | |
public Vector2 customOffset = new Vector2(0.5f, 0.5f); | |
public void OnGUI() { | |
xmlAsset = EditorGUILayout.ObjectField("XML Source", xmlAsset, typeof (TextAsset), false) as TextAsset; | |
spriteAlignment = (SpriteAlignment) EditorGUILayout.EnumPopup("Pivot", spriteAlignment); | |
bool enabled = GUI.enabled; | |
if (spriteAlignment != SpriteAlignment.Custom) { | |
GUI.enabled = false; | |
} | |
EditorGUILayout.Vector2Field("Custom Offset", customOffset); | |
GUI.enabled = enabled; | |
if (xmlAsset == null) { | |
GUI.enabled = false; | |
} | |
if (GUILayout.Button("Slice")) { | |
//PerformSlice(); | |
} | |
GUI.enabled = enabled; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment