Exemplo n.º 1
0
    /// <summary>
    /// Show the selection wizard.
    /// </summary>

    static public void Show(Callback callback, int spriteIndex)
    {
        if (instance != null)
        {
            instance.Close();
            instance = null;
        }

        SpriteSelectorForParticle2D comp = ScriptableWizard.DisplayWizard <SpriteSelectorForParticle2D>("Select a Sprite");

        comp.mSprite     = null;
        comp.spriteIndex = spriteIndex;
        comp.mCallback   = callback;
    }
Exemplo n.º 2
0
    bool DrawSpriteField(UIAtlas atlas, string spriteName, int spriteIndex, SpriteSelectorForParticle2D.Callback callback, params GUILayoutOption[] options)
    {
        if (atlas.GetSprite(spriteName) == null)
        {
            spriteName = "";
        }

        if (NGUIEditorTools.DrawPrefixButton(spriteName, options))
        {
            NGUISettings.atlas          = atlas;
            NGUISettings.selectedSprite = spriteName;
            SpriteSelectorForParticle2D.Show(callback, spriteIndex);
            return(true);
        }
        return(false);
    }
Exemplo n.º 3
0
 void OnDisable()
 {
     instance = null;
 }
Exemplo n.º 4
0
 void OnEnable()
 {
     instance = this;
 }