示例#1
0
    // show the sprite selector
    static public void Show(SVGSpriteAssetFile spriteAsset, OnPivotEditedCallback callback)
    {
        // close the current selector instance, if any
        SVGPivotEditor.CloseAll();

        if (spriteAsset != null)
        {
            SVGPivotEditor pivotEditor = SVGPivotEditor.CreateInstance <SVGPivotEditor>();
            SVGPivotEditor.Init(pivotEditor, spriteAsset, spriteAsset.SpriteData.Pivot, spriteAsset.SpriteData.Border, callback);
            pivotEditor.ShowEditor();
        }
    }
    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);
    }