Skip to content

Instantly share code, notes, and snippets.

@toxicFork

toxicFork/gist:097df5144fd824647404 Secret

Last active Aug 29, 2015
Embed
What would you like to do?
[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
You can’t perform that action at this time.