Esempio n. 1
0
    static int LoadTexture(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.Texture o    = obj.LoadTexture(arg0);
                ToLua.Push(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.Texture o    = obj.LoadTexture(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ResModuleUtility.LoadTexture"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 2
0
 protected override void Start()
 {
     base.Start();
     if (_multiRes && Application.isPlaying && texture)
     {
         InitResModule();
         Texture tex = _resModuleUtility.LoadTexture(texture.name);
         texture = tex;
         if (_multiResNativeSize)
         {
             SetNativeSize();
         }
     }
 }
Esempio n. 3
0
 public Texture GetTexture(string reskeyname, bool isTry = false)
 {
     return(resUtility.LoadTexture(reskeyname, isTry));
 }