示例#1
0
    static int LoadSprite(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                ResModuleUtility   obj  = (ResModuleUtility)ToLua.CheckObject <ResModuleUtility>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                UnityEngine.Sprite o    = obj.LoadSprite(arg0);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3)
            {
                ResModuleUtility   obj  = (ResModuleUtility)ToLua.CheckObject <ResModuleUtility>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                bool               arg1 = LuaDLL.luaL_checkboolean(L, 3);
                UnityEngine.Sprite o    = obj.LoadSprite(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ResModuleUtility.LoadSprite"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#2
0
 protected override void Start()
 {
     base.Start();
     if (_multiRes && Application.isPlaying && GameMain.Inst.lngType != LngType.CN && sprite)
     {
         InitResModule();
         Sprite loadSprite = _resModuleUtility.LoadSprite(sprite.name);
         sprite = loadSprite;
         if (_multiResNativeSize)
         {
             SetNativeSize();
         }
     }
 }
示例#3
0
 public Sprite GetSprite(string resName, bool isTry = false)
 {
     return(resUtility.LoadSprite(resName, isTry));
 }