コード例 #1
0
        public static AssetBundle LoadFromMemory(byte[] binary, uint crc = 0)
        {
            var iCall = ICallManager.GetICall <d_LoadFromMemory>("UnityEngine.AssetBundle::LoadFromMemory_Internal");

            var ptr = iCall(((Il2CppStructArray <byte>)binary).Pointer, crc);

            return(new AssetBundle(ptr));
        }
コード例 #2
0
        public static AssetBundle LoadFromFile(string path)
        {
            var iCall = ICallManager.GetICall <d_LoadFromFile>("UnityEngine.AssetBundle::LoadFromFile_Internal");

            var ptr = iCall.Invoke(IL2CPP.ManagedStringToIl2Cpp(path), 0u, 0UL);

            return(new AssetBundle(ptr));
        }
コード例 #3
0
        public T LoadAsset <T>(string name) where T : UnityEngine.Object
        {
            var iCall = ICallManager.GetICall <d_LoadAsset_Internal>("UnityEngine.AssetBundle::LoadAsset_Internal");
            var ptr   = iCall.Invoke(m_bundlePtr, IL2CPP.ManagedStringToIl2Cpp(name), Il2CppType.Of <T>().Pointer);

            if (ptr == IntPtr.Zero)
            {
                return(null);
            }

            return(new UnityEngine.Object(ptr).TryCast <T>());
        }
コード例 #4
0
        public UnityEngine.Object[] LoadAllAssets()
        {
            var iCall = ICallManager.GetICall <d_LoadAssetWithSubAssets_Internal>("UnityEngine.AssetBundle::LoadAssetWithSubAssets_Internal");
            var ptr   = iCall.Invoke(m_bundlePtr, IL2CPP.ManagedStringToIl2Cpp(""), Il2CppType.Of <UnityEngine.Object>().Pointer);

            if (ptr == IntPtr.Zero)
            {
                return(new UnityEngine.Object[0]);
            }

            return(new Il2CppReferenceArray <UnityEngine.Object>(ptr));
        }