Exemplo n.º 1
0
        public void prepareOneSprite4BorrowMode(UIAtlas atlas, string spriteName, object callback, object orgs)
        {
            UISpriteData sd = atlas.getSpriteBorrowMode(spriteName);

            if (sd != null && MapEx.get(UIAtlas.assetBundleMap, sd.path) != null)
            {
                Utl.doCallback(callback, null, spriteName, orgs);
            }
            else
            {
                atlas.borrowSpriteByname(spriteName, null, callback, orgs);
            }
        }
Exemplo n.º 2
0
    public UISpriteData getSpriteBorrowMode(string name)
    {
        if (string.IsNullOrEmpty(name))
        {
            return(null);
        }
        if (mReplacement != null)
        {
            return(mReplacement.getSpriteBorrowMode(name));
        }
        int i = spriteMap [name] == null ? -1 : (int)spriteMap [name];

        if (i < 0)
        {
                        #if UNITY_EDITOR
            Debug.LogWarning("can't find sprite ,name=[" + name + "],objname = [" + name + "]");
                        #endif
            return(null);
        }
        //      Sprite ret = sprites.Count > i ? sprites [i] : null;
        UISpriteData ret = mSprites.Count > i ? mSprites [i] : null;
        return(ret);
    }