예제 #1
0
        internal static string[] BuildExportPackageAssetListGuids(string[] guids, bool dependencies)
        {
            List <string> methods = new List <string>
            {
                "UnityEditor.PackageUtility.BuildExportPackageItemsList",
                "UnityEditor.AssetServer.BuildExportPackageAssetListAssetsItems"
            };
            MethodInfo methodInfo = BackwardsCompatibilityUtility.GetMethodInfo(methods, new Type[]
            {
                typeof(string[]),
                typeof(bool)
            });

            object[] parameters = new object[]
            {
                guids,
                dependencies
            };
            object[]  array  = (object[])methodInfo.Invoke(null, parameters);
            string[]  array2 = new string[array.Length];
            FieldInfo field  = methodInfo.ReturnType.GetElementType().GetField("guid");

            for (int i = 0; i < array.Length; i++)
            {
                string text = (string)field.GetValue(array[i]);
                array2[i] = text;
            }
            return(array2);
        }
예제 #2
0
        public AssetBundleCreateRequest LoadFromMemoryAsync(byte[] bytes)
        {
            List <string> methods = new List <string>
            {
                "UnityEngine.AssetBundle.LoadFromMemoryAsync",
                "UnityEngine.AssetBundle.CreateFromMemory"
            };
            MethodInfo methodInfo = BackwardsCompatibilityUtility.GetMethodInfo(methods, new System.Type[]
            {
                typeof(byte[])
            });

            return((AssetBundleCreateRequest)methodInfo.Invoke(null, new object[]
            {
                bytes
            }));
        }
예제 #3
0
        public static object TryStaticInvoke(List <string> methods, object[] parameters)
        {
            MethodInfo methodInfo = BackwardsCompatibilityUtility.GetMethodInfo(methods, null);

            return(methodInfo.Invoke(null, parameters));
        }