コード例 #1
0
 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
 }
コード例 #2
0
 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));
     }
 }
コード例 #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));
     }
 }
コード例 #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));
     }
 }
コード例 #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));
        }
    }
コード例 #6
0
ファイル: UIPackage.cs プロジェクト: yinlei/Fishing
 /// <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);
 }
コード例 #7
0
ファイル: UIPackage.cs プロジェクト: hxyxj/FairyGUI-unity
 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);
 }
コード例 #8
0
 public string[] GetAllAssetNames()
 {
     return(_assetBundle.GetAllAssetNames());
 }