static public int GetAllAssetNames(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.AssetBundle self = (UnityEngine.AssetBundle)checkSelf(l);
         var ret = self.GetAllAssetNames();
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static public int GetAllAssetNames(IntPtr l)
 {
     try {
         UnityEngine.AssetBundle self = (UnityEngine.AssetBundle)checkSelf(l);
         var ret = self.GetAllAssetNames();
         pushValue(l, ret);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 3
0
 static int QPYX_GetAllAssetNames_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 1);
         UnityEngine.AssetBundle QPYX_obj_YXQP = (UnityEngine.AssetBundle)ToLua.CheckObject(L_YXQP, 1, typeof(UnityEngine.AssetBundle));
         string[] QPYX_o_YXQP = QPYX_obj_YXQP.GetAllAssetNames();
         ToLua.Push(L_YXQP, QPYX_o_YXQP);
         return(1);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }
Exemplo n.º 4
0
 static int GetAllAssetNames(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.AssetBundle obj = (UnityEngine.AssetBundle)ToLua.CheckObject(L, 1, typeof(UnityEngine.AssetBundle));
         string[] o = obj.GetAllAssetNames();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 5
0
    static int GetAllAssetNames(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.AssetBundle.GetAllAssetNames");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            UnityEngine.AssetBundle obj = (UnityEngine.AssetBundle)ToLua.CheckObject(L, 1, typeof(UnityEngine.AssetBundle));
            string[] o = obj.GetAllAssetNames();
            ToLua.Push(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 6
0
 /// <summary>
 /// Add a UI package from two assetbundles with a optional main asset name.
 /// </summary>
 /// <param name="desc">A assetbunble contains description file.</param>
 /// <param name="res">A assetbundle contains resources.</param>
 /// <param name="mainAssetName">Main asset name.</param>
 /// <returns>UIPackage</returns>
 public static UIPackage AddPackage(AssetBundle desc, AssetBundle res, string mainAssetName)
 {
     string source = null;
     #if UNITY_5
     if (mainAssetName != null)
     {
         TextAsset ta = desc.LoadAsset<TextAsset>(mainAssetName);
         if (ta != null)
             source = ta.text;
     }
     else
     {
         string[] names = desc.GetAllAssetNames();
         foreach (string n in names)
         {
             if (n.IndexOf("@") == -1)
             {
                 TextAsset ta = desc.LoadAsset<TextAsset>(n);
                 if (ta != null)
                 {
                     source = ta.text;
                     if (mainAssetName == null)
                         mainAssetName = Path.GetFileNameWithoutExtension(n);
                     break;
                 }
             }
         }
     }
     #else
     if (mainAssetName != null)
     {
         TextAsset ta = (TextAsset)desc.Load(mainAssetName, typeof(TextAsset));
         if (ta != null)
             source = ta.text;
     }
     else
     {
         source = ((TextAsset)desc.mainAsset).text;
         mainAssetName = desc.mainAsset.name;
     }
     #endif
     if (source == null)
         throw new Exception("FairyGUI: invalid package.");
     if (desc != res)
         desc.Unload(true);
     return AddPackage(source, res, mainAssetName);
 }
Exemplo n.º 7
0
 public static UIPackage AddPackage(AssetBundle desc, AssetBundle res, string resourceNamePrefix)
 {
     #if UNITY_5
     byte[] bytes = desc.LoadAsset<TextAsset>(desc.GetAllAssetNames()[0]).bytes;
     #else
     byte[] bytes = ((TextAsset)desc.mainAsset).bytes;
     #endif
     if (desc != res)
         desc.Unload(true);
     return AddPackage(bytes, res, resourceNamePrefix);
 }
Exemplo n.º 8
0
 public string[] GetAllAssetNames()
 {
     return(_assetBundle.GetAllAssetNames());
 }