Esempio n. 1
0
    // show the atlas selector
    static public void Show(string atlasName, OnAtlasSelectionCallback callback)
    {
        // close the current selector instance, if any
        SVGAtlasSelector.CloseAll();

        SVGAtlasSelector selector = ScriptableWizard.DisplayWizard <SVGAtlasSelector>("Select an atlas");

        selector.m_SearchString = atlasName;
        selector.m_Callback     = callback;
        selector.m_ScrollPos    = Vector2.zero;
        selector.m_AtlasesList  = SVGAtlasSelector.GetAtlasesList();
        selector.m_Time         = Time.realtimeSinceStartup;
        selector.m_TextureIndex = 0;
    }
    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);
    }