예제 #1
0
        public void LoadGameObjectAsync(string assetPath, System.Action <GameObjectGetter> callback)
        {
            string     loadPath = GetAssetPathWithExtend(assetPath.ToLower());
            GameObject prefab   = AssetDatabase.LoadAssetAtPath <GameObject>(loadPath);

            AssetHolder      assetHolder = new AssetHolder(prefab);
            GameObjectGetter getter      = new GameObjectGetter();

            getter.SetAssetHolder(assetHolder);
            callback(getter);
        }
예제 #2
0
        public GameObjectGetter LoadGameObject(string assetPath)
        {
            string     loadPath = GetAssetPathWithExtend(assetPath.ToLower());
            GameObject prefab   = AssetDatabase.LoadAssetAtPath <GameObject>(loadPath);

            AssetHolder      assetHolder = new AssetHolder(prefab);
            GameObjectGetter getter      = new GameObjectGetter();

            getter.SetAssetHolder(assetHolder);
            return(getter);
        }
 static int LoadGameObject(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0 = ToLua.CheckString(L, 1);
         UFrame.ResourceManagement.GameObjectGetter o = ResHelper.LoadGameObject(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int Get(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UFrame.ResourceManagement.GameObjectGetter obj = (UFrame.ResourceManagement.GameObjectGetter)ToLua.CheckObject <UFrame.ResourceManagement.GameObjectGetter>(L, 1);
         UnityEngine.GameObject o = obj.Get();
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SetAssetHolder(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UFrame.ResourceManagement.GameObjectGetter obj  = (UFrame.ResourceManagement.GameObjectGetter)ToLua.CheckObject <UFrame.ResourceManagement.GameObjectGetter>(L, 1);
         UFrame.ResourceManagement.AssetHolder      arg0 = (UFrame.ResourceManagement.AssetHolder)ToLua.CheckObject <UFrame.ResourceManagement.AssetHolder>(L, 2);
         obj.SetAssetHolder(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int _CreateUFrame_ResourceManagement_GameObjectGetter(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                UFrame.ResourceManagement.GameObjectGetter obj = new UFrame.ResourceManagement.GameObjectGetter();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UFrame.ResourceManagement.GameObjectGetter.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }