Esempio n. 1
0
 static public int constructor(IntPtr l)
 {
     try {
         LBoot.BundleHelper o;
         o = new LBoot.BundleHelper();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 2
0
 void UpdateTriggerEffect()
 {
     if (!effectPrefab)
     {
         return;
     }
     if (triggerEffect && !preTrigger)
     {
         string path = FindPrefabPath(effectPrefab);
         var    go   = BundleHelper.LoadAndCreate(path, -1);
         go.transform.SetParent(gameObject.transform, false);
     }
     preTrigger = triggerEffect;
 }
Esempio n. 3
0
        public Cubemap GetWaterCubemap(string cubemapPath)
        {
            string bundlePath = null;

            water_cubemaps.TryGetValue(cubemapPath, out bundlePath);
            Cubemap cubemap = null;

            if (bundlePath != null)
            {
                var assetBundle = BundleHelper.Load(bundlePath, -1);
                if (assetBundle != null)
                {
                    cubemap = assetBundle.LoadAsset <Cubemap>(cubemapPath);
                }
            }
            return(cubemap);
        }
Esempio n. 4
0
        public static LuaBinderBehaviour Create(string bundleName, int ttl, LuaTable lua)
        {
#if PROFILE_FILE
#if PROFILE_GO_NAME
            Profiler.BeginSample("LuaBinderBehaviour.Create " + bundleName + " ttl=" + ttl);
#else
            Profiler.BeginSample("LuaBinderBehaviour.Create");
#endif // PROFILE_GO_NAME
#endif // PROFILE_FILE

            var go     = BundleHelper.LoadAndCreate(bundleName, ttl);
            var binder = go.AddComponent <LuaBinderBehaviour>();
            binder.Bind(lua);

#if PROFILE_FILE
            Profiler.EndSample();
#endif
            return(binder);
        }
Esempio n. 5
0
        public Sprite GetSprite(string spriteName)
        {
            string assetPath = null;

            sprites.TryGetValue(spriteName, out assetPath);
            if (assetPath == null)
            {
                return(null);
            }

            assetPath = "assets/" + assetPath + ".asset";
            assetPath = assetPath.ToLower();
            SpriteAsset spriteAsset = null;

#if UNITY_EDITOR
            spriteAsset = UnityEditor.AssetDatabase.LoadAssetAtPath <SpriteAsset>(assetPath);
#else
            string bundlePath = null;

            images.TryGetValue(assetPath, out bundlePath);

            if (bundlePath != null)
            {
                var assetBundle = BundleHelper.Load(bundlePath, -1);
                if (assetBundle != null)
                {
                    spriteAsset = assetBundle.LoadAsset <SpriteAsset>(assetPath);
                }
            }
#endif
            if (spriteAsset != null)
            {
                return(spriteAsset.GetSprite(spriteName));
            }

            return(null);
        }
Esempio n. 6
0
        public static void SetTTLSettings(string uri, int ttl)
        {
            var key = BundleHelper.fixBundleUri(uri);

            ttlSettings[key] = ttl;
        }