Represent the hash value.

Ejemplo n.º 1
0
        static unsafe void RegisterConversionSystems()
        {
            var systems = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.GameObjectConversion |
                                                                   WorldSystemFilterFlags.EntitySceneOptimizations);
            var nameAndVersion = new NameAndVersion[systems.Count];

            for (int i = 0; i != nameAndVersion.Length; i++)
            {
                nameAndVersion[i].FullName = systems[i].FullName;

                var systemVersionAttribute = systems[i].GetCustomAttribute <ConverterVersionAttribute>();
                if (systemVersionAttribute != null)
                {
                    nameAndVersion[i].Version = systemVersionAttribute.Version;
                }
            }

            Array.Sort(nameAndVersion);

            UnityEngine.Hash128 hash = default;
            for (int i = 0; i != nameAndVersion.Length; i++)
            {
                var fullName = nameAndVersion[i].FullName;
                fixed(char *str = fullName)
                {
                    HashUnsafeUtilities.ComputeHash128(str, (ulong)(sizeof(char) * fullName.Length), &hash);
                }

                int version = nameAndVersion[i].Version;
                HashUnsafeUtilities.ComputeHash128(&version, sizeof(int), &hash);
            }

            UnityEditor.Experimental.AssetDatabaseExperimental.RegisterCustomDependency(SystemsVersion, hash);
        }
// fields

// properties
    static void Hash128_isValid(JSVCall vc)
    {
        UnityEngine.Hash128 _this = (UnityEngine.Hash128)vc.csObj;
        var result = _this.isValid;

        JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
    }
Ejemplo n.º 3
0
        public unsafe void GetOrCreateSharedMemoryBasic()
        {
            const uint kMemSize   = 64;
            const uint kAlignment = 16;
            Hash128    hash1      = new Hash128(0, 1, 2, 3);
            Hash128    hash2      = new Hash128(3, 2, 1, 0);

            // NOTE: These tests will leak as memory from GetOrCreateSharedMemory is meant to be freed with the process
            {
                void *pMem1 = Burst.LowLevel.BurstCompilerService.GetOrCreateSharedMemory(ref hash1, kMemSize, kAlignment);
                void *pMem2 = Burst.LowLevel.BurstCompilerService.GetOrCreateSharedMemory(ref hash1, kMemSize, kAlignment);
                Assert.AreEqual((ulong)pMem1, (ulong)pMem2);
                Assert.IsTrue(((ulong)pMem1 & (kAlignment - 1)) == 0);
                FillMemory((byte *)pMem1, kMemSize);
                Assert.IsTrue(UnsafeUtility.MemCmp(pMem1, pMem2, kMemSize) == 0);
            }

            {
                byte *pMem1 = (byte *)Burst.LowLevel.BurstCompilerService.GetOrCreateSharedMemory(ref hash1, kMemSize, kAlignment);
                byte *pMem2 = (byte *)Burst.LowLevel.BurstCompilerService.GetOrCreateSharedMemory(ref hash2, kMemSize, kAlignment);
                Assert.AreNotEqual((ulong)pMem1, (ulong)pMem2);
                Assert.IsTrue(((ulong)pMem1 & (kAlignment - 1)) == 0);
                Assert.IsTrue(((ulong)pMem2 & (kAlignment - 1)) == 0);
                FillMemory((byte *)pMem1, kMemSize);
                Assert.IsFalse(UnsafeUtility.MemCmp(pMem1, pMem2, kMemSize) == 0);
            }
        }
        static unsafe TypeDependencyCache()
        {
            //TODO: Find a better way to enforce Version 2 compatibility
            bool v2Enabled = (bool)typeof(AssetDatabase).GetMethod("IsV2Enabled", BindingFlags.NonPublic | BindingFlags.Static).Invoke(null, null);

            if (!v2Enabled)
            {
                throw new System.InvalidOperationException("com.unity.entities requires Asset Pipeline Version 2. Please enable Version 2 in Project Settings / Editor / Asset Pipeline / Mode");
            }

            // Custom dependencies are transmitted to the import worker so dont spent time on registering them
            if (AssetDatabaseCompatibility.IsAssetImportWorkerProcess())
            {
                return;
            }

            using (kRegisterComponentTypes.Auto())
                RegisterComponentTypes();

            using (kRegisterConversionSystemVersions.Auto())
                RegisterConversionSystems();

            int fileFormatVersion = SerializeUtility.CurrentFileFormatVersion;

            UnityEngine.Hash128 fileFormatHash = default;
            HashUnsafeUtilities.ComputeHash128(&fileFormatVersion, sizeof(int), &fileFormatHash);
            AssetDatabaseCompatibility.RegisterCustomDependency("EntityBinaryFileFormatVersion", fileFormatHash);

            int sceneFileFormatVersion = SceneMetaDataSerializeUtility.CurrentFileFormatVersion;

            UnityEngine.Hash128 sceneFileFormatHash = default;
            HashUnsafeUtilities.ComputeHash128(&sceneFileFormatVersion, sizeof(int), &sceneFileFormatHash);
            AssetDatabaseCompatibility.RegisterCustomDependency("SceneMetaDataFileFormatVersion", sceneFileFormatHash);
        }
 static bool Hash128_op_Inequality__Hash128__Hash128(JSVCall vc, int argc)
 {
     UnityEngine.Hash128 arg0 = (UnityEngine.Hash128)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
     UnityEngine.Hash128 arg1 = (UnityEngine.Hash128)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
     JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(arg0 != arg1));
     return(true);
 }
    static int GetAssetBundle(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.Networking.UnityWebRequest o = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2)
            {
                string arg0 = ToLua.CheckString(L, 1);
                uint   arg1 = (uint)LuaDLL.luaL_checknumber(L, 2);
                UnityEngine.Networking.UnityWebRequest o = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.CachedAssetBundle, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.CachedAssetBundle arg1 = StackTraits <UnityEngine.CachedAssetBundle> .To(L, 2);

                uint arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.Networking.UnityWebRequest o = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Hash128, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.Hash128 arg1 = StackTraits <UnityEngine.Hash128> .To(L, 2);

                uint arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.Networking.UnityWebRequest o = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <uint, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                uint   arg1 = (uint)LuaDLL.lua_tonumber(L, 2);
                uint   arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.Networking.UnityWebRequest o = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.Networking.UnityWebRequest.GetAssetBundle"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 7
0
    static int LoadFromCacheOrDownload(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(UnityEngine.Hash128)))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.Hash128 arg1 = (UnityEngine.Hash128)ToLua.ToObject(L, 2);
                UnityEngine.WWW     o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(int)))
            {
                string          arg0 = ToLua.ToString(L, 1);
                int             arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(UnityEngine.CachedAssetBundle), typeof(uint)))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.CachedAssetBundle arg1 = (UnityEngine.CachedAssetBundle)ToLua.ToObject(L, 2);
                uint            arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(UnityEngine.Hash128), typeof(uint)))
            {
                string arg0 = ToLua.ToString(L, 1);
                UnityEngine.Hash128 arg1 = (UnityEngine.Hash128)ToLua.ToObject(L, 2);
                uint            arg2     = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.WWW o        = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(string), typeof(int), typeof(uint)))
            {
                string          arg0 = ToLua.ToString(L, 1);
                int             arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                uint            arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1, arg2);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.WWW.LoadFromCacheOrDownload"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        static unsafe void RegisterConversionSystems()
        {
            var systems        = DefaultWorldInitialization.GetAllSystems(WorldSystemFilterFlags.GameObjectConversion | WorldSystemFilterFlags.EntitySceneOptimizations);
            var behaviours     = TypeCache.GetTypesDerivedFrom <IConvertGameObjectToEntity>();
            var nameAndVersion = new NameAndVersion[systems.Count + behaviours.Count];

            int count = 0;

            // System versions
            for (int i = 0; i != systems.Count; i++)
            {
                var fullName = systems[i].FullName;
                if (fullName == null)
                {
                    continue;
                }

                nameAndVersion[count++].Init(systems[i], fullName);
            }

            // IConvertGameObjectToEntity versions
            for (int i = 0; i != behaviours.Count; i++)
            {
                var fullName = behaviours[i].FullName;
                if (fullName == null)
                {
                    continue;
                }

                nameAndVersion[count++].Init(behaviours[i], fullName);
            }

            Array.Sort(nameAndVersion, 0, count);

            UnityEngine.Hash128 hash = default;
            for (int i = 0; i != count; i++)
            {
                var fullName = nameAndVersion[i].FullName;
                fixed(char *str = fullName)
                {
                    HashUnsafeUtilities.ComputeHash128(str, (ulong)(sizeof(char) * fullName.Length), &hash);
                }

                var userName = nameAndVersion[i].UserName;
                if (userName != null)
                {
                    fixed(char *str = userName)
                    {
                        HashUnsafeUtilities.ComputeHash128(str, (ulong)(sizeof(char) * userName.Length), &hash);
                    }
                }

                int version = nameAndVersion[i].Version;
                HashUnsafeUtilities.ComputeHash128(&version, sizeof(int), &hash);
            }

            AssetDatabaseCompatibility.RegisterCustomDependency(SystemsVersion, hash);
        }
    static int QPYX_GetAssetBundle_YXQP(IntPtr L_YXQP)
    {
        try
        {
            int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
            if (QPYX_count_YXQP == 1)
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                UnityEngine.Networking.UnityWebRequest QPYX_o_YXQP = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(QPYX_arg0_YXQP);
                ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 2)
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                uint   QPYX_arg1_YXQP = (uint)LuaDLL.luaL_checknumber(L_YXQP, 2);
                UnityEngine.Networking.UnityWebRequest QPYX_o_YXQP = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
                ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.CachedAssetBundle, uint>(L_YXQP, 2))
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                UnityEngine.CachedAssetBundle QPYX_arg1_YXQP = StackTraits <UnityEngine.CachedAssetBundle> .To(L_YXQP, 2);

                uint QPYX_arg2_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 3);
                UnityEngine.Networking.UnityWebRequest QPYX_o_YXQP = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
                ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.Hash128, uint>(L_YXQP, 2))
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                UnityEngine.Hash128 QPYX_arg1_YXQP = StackTraits <UnityEngine.Hash128> .To(L_YXQP, 2);

                uint QPYX_arg2_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 3);
                UnityEngine.Networking.UnityWebRequest QPYX_o_YXQP = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
                ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <uint, uint>(L_YXQP, 2))
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                uint   QPYX_arg1_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 2);
                uint   QPYX_arg2_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 3);
                UnityEngine.Networking.UnityWebRequest QPYX_o_YXQP = UnityEngine.Networking.UnityWebRequest.GetAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
                ToLua.PushObject(L_YXQP, QPYX_o_YXQP);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to method: UnityEngine.Networking.UnityWebRequest.GetAssetBundle"));
            }
        }
        catch (Exception e_YXQP)                {
            return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
        }
    }
    static int _CreateUnityEngine_Networking_DownloadHandlerAssetBundle(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                string arg0 = ToLua.CheckString(L, 1);
                uint   arg1 = (uint)LuaDLL.luaL_checknumber(L, 2);
                UnityEngine.Networking.DownloadHandlerAssetBundle obj = new UnityEngine.Networking.DownloadHandlerAssetBundle(arg0, arg1);
                ToLua.PushSealed(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Hash128, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.Hash128 arg1 = StackTraits <UnityEngine.Hash128> .To(L, 2);

                uint arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.Networking.DownloadHandlerAssetBundle obj = new UnityEngine.Networking.DownloadHandlerAssetBundle(arg0, arg1, arg2);
                ToLua.PushSealed(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <uint, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                uint   arg1 = (uint)LuaDLL.lua_tonumber(L, 2);
                uint   arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.Networking.DownloadHandlerAssetBundle obj = new UnityEngine.Networking.DownloadHandlerAssetBundle(arg0, arg1, arg2);
                ToLua.PushSealed(L, obj);
                return(1);
            }
            else if (count == 4)
            {
                string arg0 = ToLua.CheckString(L, 1);
                string arg1 = ToLua.CheckString(L, 2);
                UnityEngine.Hash128 arg2 = StackTraits <UnityEngine.Hash128> .Check(L, 3);

                uint arg3 = (uint)LuaDLL.luaL_checknumber(L, 4);
                UnityEngine.Networking.DownloadHandlerAssetBundle obj = new UnityEngine.Networking.DownloadHandlerAssetBundle(arg0, arg1, arg2, arg3);
                ToLua.PushSealed(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Networking.DownloadHandlerAssetBundle.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static bool Hash128_GetHashCode(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.Hash128 argThis = (UnityEngine.Hash128)vc.csObj;                JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(argThis.GetHashCode()));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
    static bool Hash128_ToString(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.Hash128 argThis = (UnityEngine.Hash128)vc.csObj;                JSApi.setStringS((int)JSApi.SetType.Rval, argThis.ToString());
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Ejemplo n.º 13
0
    static int LoadFromCacheOrDownload(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <UnityEngine.Hash128>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.Hash128 arg1 = StackTraits <UnityEngine.Hash128> .To(L, 2);

                UnityEngine.WWW o = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <int>(L, 2))
            {
                string          arg0 = ToLua.CheckString(L, 1);
                int             arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Hash128, uint>(L, 2))
            {
                string arg0 = ToLua.CheckString(L, 1);
                UnityEngine.Hash128 arg1 = StackTraits <UnityEngine.Hash128> .To(L, 2);

                uint            arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1, arg2);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <int, uint>(L, 2))
            {
                string          arg0 = ToLua.CheckString(L, 1);
                int             arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                uint            arg2 = (uint)LuaDLL.lua_tonumber(L, 3);
                UnityEngine.WWW o    = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1, arg2);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.WWW.LoadFromCacheOrDownload"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int QPYX__CreateUnityEngine_Networking_DownloadHandlerAssetBundle_YXQP(IntPtr L_YXQP)
    {
        try
        {
            int QPYX_count_YXQP = LuaDLL.lua_gettop(L_YXQP);
            if (QPYX_count_YXQP == 2)
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                uint   QPYX_arg1_YXQP = (uint)LuaDLL.luaL_checknumber(L_YXQP, 2);
                UnityEngine.Networking.DownloadHandlerAssetBundle QPYX_obj_YXQP = new UnityEngine.Networking.DownloadHandlerAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
                ToLua.PushSealed(L_YXQP, QPYX_obj_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <UnityEngine.Hash128, uint>(L_YXQP, 2))
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                UnityEngine.Hash128 QPYX_arg1_YXQP = StackTraits <UnityEngine.Hash128> .To(L_YXQP, 2);

                uint QPYX_arg2_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 3);
                UnityEngine.Networking.DownloadHandlerAssetBundle QPYX_obj_YXQP = new UnityEngine.Networking.DownloadHandlerAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
                ToLua.PushSealed(L_YXQP, QPYX_obj_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 3 && TypeChecker.CheckTypes <uint, uint>(L_YXQP, 2))
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                uint   QPYX_arg1_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 2);
                uint   QPYX_arg2_YXQP = (uint)LuaDLL.lua_tonumber(L_YXQP, 3);
                UnityEngine.Networking.DownloadHandlerAssetBundle QPYX_obj_YXQP = new UnityEngine.Networking.DownloadHandlerAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP);
                ToLua.PushSealed(L_YXQP, QPYX_obj_YXQP);
                return(1);
            }
            else if (QPYX_count_YXQP == 4)
            {
                string QPYX_arg0_YXQP = ToLua.CheckString(L_YXQP, 1);
                string QPYX_arg1_YXQP = ToLua.CheckString(L_YXQP, 2);
                UnityEngine.Hash128 QPYX_arg2_YXQP = StackTraits <UnityEngine.Hash128> .Check(L_YXQP, 3);

                uint QPYX_arg3_YXQP = (uint)LuaDLL.luaL_checknumber(L_YXQP, 4);
                UnityEngine.Networking.DownloadHandlerAssetBundle QPYX_obj_YXQP = new UnityEngine.Networking.DownloadHandlerAssetBundle(QPYX_arg0_YXQP, QPYX_arg1_YXQP, QPYX_arg2_YXQP, QPYX_arg3_YXQP);
                ToLua.PushSealed(L_YXQP, QPYX_obj_YXQP);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L_YXQP, "invalid arguments to ctor method: UnityEngine.Networking.DownloadHandlerAssetBundle.New"));
            }
        }
        catch (Exception e_YXQP)                {
            return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
        }
    }
Ejemplo n.º 15
0
 static public int ctor_s(IntPtr l)
 {
     try {
         UnityEngine.Hash128 o;
         o = new UnityEngine.Hash128();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static bool Caching_MarkAsUsed__String__Hash128(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            System.String       arg0 = (System.String)JSApi.getStringS((int)JSApi.GetType.Arg);
            UnityEngine.Hash128 arg1 = (UnityEngine.Hash128)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(UnityEngine.Caching.MarkAsUsed(arg0, arg1)));
        }

        return(true);
    }
Ejemplo n.º 17
0
    static bool WWW_LoadFromCacheOrDownload__String__Hash128(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 2)
        {
            System.String       arg0 = (System.String)JSApi.getStringS((int)JSApi.GetType.Arg);
            UnityEngine.Hash128 arg1 = (UnityEngine.Hash128)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            JSMgr.datax.setObject((int)JSApi.SetType.Rval, UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1));
        }

        return(true);
    }
// methods

    static bool Hash128_Equals__Object(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 1)
        {
            System.Object       arg0    = (System.Object)JSMgr.datax.getWhatever((int)JSApi.GetType.Arg);
            UnityEngine.Hash128 argThis = (UnityEngine.Hash128)vc.csObj;                JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(argThis.Equals(arg0)));
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Ejemplo n.º 19
0
        /// <summary>
        /// Returns a hash that can be used as a guid within a (non-persistent) session to refer to this UnityEngine.Object.
        /// </summary>
        public static Hash128 ComputeInstanceHash(this UnityObject @this)
        {
            if (@this is Component component)
            {
                @this = component.gameObject;
            }

            var instanceID = @this.GetInstanceID();

            var hash = new UnityEngine.Hash128();

            HashUtilities.ComputeHash128(ref instanceID, ref hash);
            return(hash);
        }
 static int GetAssetBundleHash(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         UnityEngine.AssetBundleManifest obj = (UnityEngine.AssetBundleManifest)ToLua.CheckObject <UnityEngine.AssetBundleManifest>(L, 1);
         string arg0           = ToLua.CheckString(L, 2);
         UnityEngine.Hash128 o = obj.GetAssetBundleHash(arg0);
         ToLua.PushValue(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 21
0
    public static void CreatePanel(EntityManager dstManager, GameObjectConversionSystem conversionSystem, GameObject gameObject, GameObject prefab, LocalToWorld localToWorld)
    {
        var meshRenderer = prefab.GetComponent <MeshRenderer>();
        var meshFilter   = prefab.GetComponent <MeshFilter>();
        var materials    = new List <Material>(10);
        var mesh         = meshFilter.sharedMesh;

        meshRenderer.GetSharedMaterials(materials);

        var segmentEntity = conversionSystem.CreateAdditionalEntity(gameObject);
        var pos           = localToWorld.Position;

        var renderBounds = new RenderBounds
        {
            Value = new AABB
            {
                Center  = new float3(0.0f, 0.0f, 0.0f),
                Extents = new float3(0.5f, 0.5f, 0.5f)
            }
        };
        var worldRenderBounds = new WorldRenderBounds
        {
            Value = new AABB
            {
                Center  = pos,
                Extents = new float3(0.5f, 0.5f, 0.5f)
            }
        };
        var frozenRenderSceneTag = new FrozenRenderSceneTag
        {
            HasStreamedLOD = 0,
            SceneGUID      = Hash128.Compute("Grid Panel"),
            SectionIndex   = 0
        };

#if UNITY_EDITOR
        dstManager.SetName(segmentEntity, "Grid Panel");
#endif
        dstManager.AddComponentData(segmentEntity, localToWorld);
        dstManager.AddComponentData(segmentEntity, renderBounds);

        dstManager.AddComponentData(segmentEntity, worldRenderBounds);
        dstManager.AddSharedComponentData(segmentEntity, frozenRenderSceneTag);
        dstManager.AddComponent(segmentEntity, typeof(Static));

        CreateRenderMesh(segmentEntity, dstManager, conversionSystem, meshRenderer, mesh, materials);
    }
Ejemplo n.º 22
0
    static int set_imageContentsHash(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Texture obj  = (UnityEngine.Texture)o;
            UnityEngine.Hash128 arg0 = (UnityEngine.Hash128)ToLua.CheckObject(L, 2, typeof(UnityEngine.Hash128));
            obj.imageContentsHash = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index imageContentsHash on a nil value" : e.Message));
        }
    }
Ejemplo n.º 23
0
    static int get_imageContentsHash(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Texture obj = (UnityEngine.Texture)o;
            UnityEngine.Hash128 ret = obj.imageContentsHash;
            ToLua.PushValue(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index imageContentsHash on a nil value" : e.Message));
        }
    }
Ejemplo n.º 24
0
 static public int ctor__UInt64__UInt64_s(IntPtr l)
 {
     try {
         UnityEngine.Hash128 o;
         System.UInt64       a1;
         checkType(l, 1, out a1);
         System.UInt64 a2;
         checkType(l, 2, out a2);
         o = new UnityEngine.Hash128(a1, a2);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 25
0
    static int LoadFromCacheOrDownload1(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            string arg0 = ToLua.ToString(L, 1);
            UnityEngine.Hash128 arg1 = StackTraits <UnityEngine.Hash128> .To(L, 2);

            var o = UnityEngine.WWW.LoadFromCacheOrDownload(arg0, arg1);
            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 26
0
 static public int constructor(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         UnityEngine.Hash128 o;
         if (argc == 6)
         {
             System.UInt32 a1;
             checkType(l, 3, out a1);
             System.UInt32 a2;
             checkType(l, 4, out a2);
             System.UInt32 a3;
             checkType(l, 5, out a3);
             System.UInt32 a4;
             checkType(l, 6, out a4);
             o = new UnityEngine.Hash128(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc == 4)
         {
             System.UInt64 a1;
             checkType(l, 3, out a1);
             System.UInt64 a2;
             checkType(l, 4, out a2);
             o = new UnityEngine.Hash128(a1, a2);
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         else if (argc <= 2)
         {
             o = new UnityEngine.Hash128();
             pushValue(l, true);
             pushValue(l, o);
             return(2);
         }
         return(error(l, "New object failed."));
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 27
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Hash128 o;
         System.UInt32       a1;
         checkType(l, 2, out a1);
         System.UInt32 a2;
         checkType(l, 3, out a2);
         System.UInt32 a3;
         checkType(l, 4, out a3);
         System.UInt32 a4;
         checkType(l, 5, out a4);
         o = new UnityEngine.Hash128(a1, a2, a3, a4);
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Hash128 o;
			System.UInt32 a1;
			checkType(l,2,out a1);
			System.UInt32 a2;
			checkType(l,3,out a2);
			System.UInt32 a3;
			checkType(l,4,out a3);
			System.UInt32 a4;
			checkType(l,5,out a4);
			o=new UnityEngine.Hash128(a1,a2,a3,a4);
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 29
0
        public void TestSceneLoad([Values(1, 2, 3, 10)] int total)
        {
            PersistencySettings settings = CreateTestSettings();

            // override the settings field
            PersistentSceneSystem persistentSceneSystem = World.GetOrCreateSystem <PersistentSceneSystem>();

            persistentSceneSystem.ReplaceSettings(settings);

            // Load SubScenes
            for (int i = 0; i < total; i++)
            {
                Unity.Entities.Hash128 sceneGUID = Hash128.Compute(i);
                LoadFakeSubScene(settings, sceneGUID, i + 10);
            }

            persistentSceneSystem.Update();

            for (int i = 0; i < total; i++)
            {
                Unity.Entities.Hash128 sceneGUID = Hash128.Compute(i);
                // Since BeginFramePersistencySystem hasn't run, this data will be uninitialized.
                // We're only interested if it's the container exists & if it's the right size
                Assert.True(persistentSceneSystem.PersistentDataStorage.IsInitialized(sceneGUID),
                            "Expected the subscene to have an initialized PersistentDataContainer");

                PersistentDataContainer container = persistentSceneSystem.PersistentDataStorage.GetReadContainerForLatestWriteIndex(sceneGUID, out bool isInitial);

                Assert.True(isInitial);
                Assert.True(container.DataIdentifier == sceneGUID,
                            $"Expected the container to have the sceneGUID {sceneGUID} as data identifier, but it was {container.DataIdentifier}.");
                Assert.True(container.DataLayoutCount == 6,
                            $"LoadFakeSubScene creates 6 different types of persistable entities so we expect 6 different data layouts in the container, but it reports {container.DataLayoutCount}");

                int entitiesInScene     = (i + 10) * 6;
                int entitiesInContainer = container.CalculateEntityCapacity();
                Assert.True(entitiesInContainer == entitiesInScene,
                            $"LoadFakeSubScene created {entitiesInScene} entities, but the container reports {entitiesInContainer}.");
            }
            m_Manager.DestroyEntity(m_Manager.UniversalQuery);
        }
Ejemplo n.º 30
0
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Hash128 o;
         System.UInt32 a1;
         checkType(l,2,out a1);
         System.UInt32 a2;
         checkType(l,3,out a2);
         System.UInt32 a3;
         checkType(l,4,out a3);
         System.UInt32 a4;
         checkType(l,5,out a4);
         o=new UnityEngine.Hash128(a1,a2,a3,a4);
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
        //@TODO: The asset pipeline should be building & cache the asset bundle
        public string BuildAssetBundleIfNotCached(GUID guid, out Hash128 targetHash)
        {
            //@TODO Get build target from player requesting it...
            var buildTarget = EditorUserBuildSettings.activeBuildTarget;

            targetHash = LiveLinkBuildPipeline.CalculateTargetHash(guid, buildTarget);

            // TODO: Move caching into LiveLinkBuildPipeline
            var cachePath = ResolveCachePath(targetHash);

            if (File.Exists(cachePath))
            {
                return(cachePath);
            }

            if (!Directory.Exists(cachePath))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(cachePath));
            }

            // Debug.Log($"Building {guid} fresh");
            // Patching only works if the ObjectManifest comes from the same GUID every time.
            // So we can't delete this file. Optimally we would control the build pipeline
            // to make it always be at a specific local identifier in file
            var manifest = ScriptableObject.CreateInstance <AssetObjectManifest>();

            AssetObjectManifestBuilder.BuildManifest(guid, manifest);
            UnityEditorInternal.InternalEditorUtility.SaveToSerializedFileAndForget(new[] { manifest }, AssetObjectManifestPath, true);

            var didSucceed = LiveLinkBuildPipeline.BuildAssetBundle(guid, $"{cachePath}", EditorUserBuildSettings.activeBuildTarget);

            if (!didSucceed)
            {
                Debug.LogError($"Failed to build asset bundle: '{guid}'");
                return(null);
            }

            return(cachePath);
        }
Ejemplo n.º 32
0
 static public int constructor(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.Hash128 o;
         System.UInt32       a1;
         checkType(l, 2, out a1);
         System.UInt32 a2;
         checkType(l, 3, out a2);
         System.UInt32 a3;
         checkType(l, 4, out a3);
         System.UInt32 a4;
         checkType(l, 5, out a4);
         o = new UnityEngine.Hash128(a1, a2, a3, a4);
         pushValue(l, true);
         pushValue(l, o);
         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
 }
Ejemplo n.º 33
0
 internal static extern bool GetInputSystemHash(Renderer renderer, out Hash128 inputSystemHash);
Ejemplo n.º 34
0
 /// <summary>
 ///   <para>Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage.</para>
 /// </summary>
 /// <param name="url">The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped.</param>
 /// <param name="version">Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url.</param>
 /// <param name="crc">An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle.</param>
 /// <returns>
 ///   <para>A WWW instance, which can be used to access the data once the load/download operation is completed.</para>
 /// </returns>
 public static WWW LoadFromCacheOrDownload(string url, int version, [DefaultValue("0")] uint crc)
 {
   Hash128 hash = new Hash128(0U, 0U, 0U, (uint) version);
   return WWW.LoadFromCacheOrDownload(url, hash, crc);
 }
Ejemplo n.º 35
0
 private static extern void INTERNAL_CALL_ResetNoBackupFlag(string url, ref Hash128 hash);
 /// <summary>
 /// <para>Simple versioned constructor. Caches downloaded asset bundles.</para>
 /// </summary>
 /// <param name="url">The nominal (pre-redirect) URL at which the asset bundle is located.</param>
 /// <param name="crc">A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking.</param>
 /// <param name="version">Current version number of the asset bundle at url. Increment to redownload.</param>
 public DownloadHandlerAssetBundle(string url, uint version, uint crc)
 {
     Hash128 hash = new Hash128(0, 0, 0, version);
     base.InternalCreateAssetBundle(url, hash, crc);
 }
Ejemplo n.º 37
0
 public static bool MarkAsUsed(string url, Hash128 hash)
 {
   return Caching.INTERNAL_CALL_MarkAsUsed(url, ref hash);
 }
Ejemplo n.º 38
0
 public static UnityWebRequest GetAssetBundle(string uri, Hash128 hash, uint crc)
 {
     return new UnityWebRequest(uri, "GET", new DownloadHandlerAssetBundle(uri, hash, crc), null);
 }
Ejemplo n.º 39
0
 private static extern bool INTERNAL_CALL_IsVersionCached(string url, ref Hash128 hash);
 private static extern void INTERNAL_CALL_GetAssetBundleHash(AssetBundleManifest self, string assetBundleName, out Hash128 value);
Ejemplo n.º 41
0
 public static extern bool GetHashForAssetBundle(string targetPath, out Hash128 hash);
 /// <summary>
 /// <para>Versioned constructor. Caches downloaded asset bundles.</para>
 /// </summary>
 /// <param name="url">The nominal (pre-redirect) URL at which the asset bundle is located.</param>
 /// <param name="crc">A checksum to compare to the downloaded data for integrity checking, or zero to skip integrity checking.</param>
 /// <param name="hash">A hash object defining the version of the asset bundle.</param>
 public DownloadHandlerAssetBundle(string url, Hash128 hash, uint crc)
 {
     base.InternalCreateAssetBundle(url, hash, crc);
 }
Ejemplo n.º 43
0
    static int _CreateHash128(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 4)
        {
            uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 1);
            uint arg1 = (uint)LuaScriptMgr.GetNumber(L, 2);
            uint arg2 = (uint)LuaScriptMgr.GetNumber(L, 3);
            uint arg3 = (uint)LuaScriptMgr.GetNumber(L, 4);
            Hash128 obj = new Hash128(arg0,arg1,arg2,arg3);
            LuaScriptMgr.PushValue(L, obj);
            return 1;
        }
        else if (count == 0)
        {
            Hash128 obj = new Hash128();
            LuaScriptMgr.PushValue(L, obj);
            return 1;
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: Hash128.New");
        }

        return 0;
    }
Ejemplo n.º 44
0
 private static extern void INTERNAL_CALL_WWW(WWW self, string url, ref Hash128 hash, uint crc);
Ejemplo n.º 45
0
 public static void SetNoBackupFlag(string url, Hash128 hash)
 {
     INTERNAL_CALL_SetNoBackupFlag(url, ref hash);
 }
Ejemplo n.º 46
0
 public static WWW LoadFromCacheOrDownload(string url, Hash128 hash)
 {
     uint crc = 0;
     return LoadFromCacheOrDownload(url, hash, crc);
 }
Ejemplo n.º 47
0
 /// <summary>
 /// <para>Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage.</para>
 /// </summary>
 /// <param name="url">The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped.</param>
 /// <param name="version">Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url.</param>
 /// <param name="crc">An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle.</param>
 /// <returns>
 /// <para>A WWW instance, which can be used to access the data once the load/download operation is completed.</para>
 /// </returns>
 public static WWW LoadFromCacheOrDownload(string url, int version, [UnityEngine.Internal.DefaultValue("0")] uint crc)
 {
     Hash128 hash = new Hash128(0, 0, 0, (uint) version);
     return LoadFromCacheOrDownload(url, hash, crc);
 }
Ejemplo n.º 48
0
 private static extern void INTERNAL_CALL_Parse(string hashString, out Hash128 value);
Ejemplo n.º 49
0
 public static IObservable<AssetBundle> LoadFromCacheOrDownload(string url, Hash128 hash128, uint crc, IProgress<float> progress = null)
 {
     return ObservableUnity.FromCoroutine<AssetBundle>((observer, cancellation) => FetchAssetBundle(WWW.LoadFromCacheOrDownload(url, hash128, crc), observer, progress, cancellation));
 }
Ejemplo n.º 50
0
 public static void ResetNoBackupFlag(string url, Hash128 hash)
 {
   Caching.INTERNAL_CALL_ResetNoBackupFlag(url, ref hash);
 }
Ejemplo n.º 51
0
 internal static extern bool GetGeometryHash(Renderer renderer, out Hash128 geometryHash);
Ejemplo n.º 52
0
 public static bool IsVersionCached(string url, Hash128 hash)
 {
   return Caching.INTERNAL_CALL_IsVersionCached(url, ref hash);
 }
Ejemplo n.º 53
0
 internal static extern bool GetInstanceHash(Renderer renderer, out Hash128 instanceHash);
Ejemplo n.º 54
0
 /// <summary>
 ///   <para>Checks if an AssetBundle is cached.</para>
 /// </summary>
 /// <param name="string">Url The filename of the AssetBundle. Domain and path information are stripped from this string automatically.</param>
 /// <param name="int">Version The version number of the AssetBundle to check for. Negative values are not allowed.</param>
 /// <param name="url"></param>
 /// <param name="version"></param>
 /// <returns>
 ///   <para>True if an AssetBundle matching the url and version parameters has previously been loaded using WWW.LoadFromCacheOrDownload() and is currently stored in the cache. Returns false if the AssetBundle is not in cache, either because it has been flushed from the cache or was never loaded using the Caching API.</para>
 /// </returns>
 public static bool IsVersionCached(string url, int version)
 {
   Hash128 hash = new Hash128(0U, 0U, 0U, (uint) version);
   return Caching.IsVersionCached(url, hash);
 }
Ejemplo n.º 55
0
 public static WWW LoadFromCacheOrDownload(string url, Hash128 hash, [UnityEngine.Internal.DefaultValue("0")] uint crc)
 {
     return new WWW(url, hash, crc);
 }
Ejemplo n.º 56
0
 /// <summary>
 ///   <para>Bumps the timestamp of a cached file to be the current time.</para>
 /// </summary>
 /// <param name="url"></param>
 /// <param name="version"></param>
 public static bool MarkAsUsed(string url, int version)
 {
   Hash128 hash = new Hash128(0U, 0U, 0U, (uint) version);
   return Caching.MarkAsUsed(url, hash);
 }
Ejemplo n.º 57
0
 internal WWW(string url, Hash128 hash, uint crc)
 {
     INTERNAL_CALL_WWW(this, url, ref hash, crc);
 }
Ejemplo n.º 58
0
 private static extern bool INTERNAL_CALL_MarkAsUsed(string url, ref Hash128 hash);