public override void OnInspectorGUI() { DrawDefaultInspector(); if (GUILayout.Button("Select Image")) { SpritePackSpriteSelector.Show(_image.SpritePack, OnSelectSprite, true, _image.SpriteName); } }
public static void Show(SpritePack spritePack, Callback callback, bool closeWhenSelected, string selectedSprite) { if (_instance != null) { _instance.Close(); _instance = null; } var comp = ScriptableWizard.DisplayWizard <SpritePackSpriteSelector>("Select a Sprite"); comp._spritePack = spritePack; comp._callback = callback; comp._selectedSprite = selectedSprite; comp._closeWhenSelected = closeWhenSelected; comp._partialSprite = string.Empty; }
public override void OnInspectorGUI() { DrawDefaultInspector(); if (!_sprAtlasPack.IsResourcesEqual(_sourceDest)) { UpdateSprites(); } if (GUILayout.Button("View Images")) { SpritePackSpriteSelector.Show(_sprAtlasPack, OnSelectSprite, false, string.Empty); } if (GUILayout.Button("Force Update Images")) { UpdateSprites(); } }
void OnDisable() => _instance = null;
void OnEnable() => _instance = this;