Example #1
0
    // show the sprite selector
    static public void Show(SVGBasicAtlas atlas, string spriteName, OnSpriteSelectionCallback callback)
    {
        // close the current selector instance, if any
        SVGSpriteSelector.CloseAll();

        if (atlas != null)
        {
            SVGSpriteSelector selector = ScriptableWizard.DisplayWizard <SVGSpriteSelector>("Select a sprite");
            selector.m_Atlas        = atlas;
            selector.m_SearchString = spriteName;
            selector.m_Callback     = callback;
            selector.m_ScrollPos    = Vector2.zero;
            selector.m_SpritesList  = SVGSpriteSelector.GetSpritesList(atlas);
        }
    }
    protected bool UpdateButtonDraw(SVGBasicAtlas atlas)
    {
        bool pushed = false;
        // update button
        string updateStr = (atlas.NeedsUpdate()) ? "Update *" : "Update";

        if (GUILayout.Button(updateStr))
        {
            // close all modal popup editors
            SVGPivotEditor.CloseAll();
            SVGSpriteSelector.CloseAll();
            SVGAtlasSelector.CloseAll();
            pushed = true;
        }

        return(pushed);
    }