コード例 #1
0
 public override void OnInspectorGUI()
 {
     DrawDefaultInspector();
     if (GUILayout.Button("Select Image"))
     {
         SpritePackSpriteSelector.Show(_image.SpritePack, OnSelectSprite, true, _image.SpriteName);
     }
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
 void OnDisable() => _instance = null;
コード例 #5
0
 void OnEnable() => _instance  = this;