• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# UnityEngine.AssetBundle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UnityEngine.AssetBundle的典型用法代码示例。如果您正苦于以下问题:C# AssetBundle类的具体用法?C# AssetBundle怎么用?C# AssetBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AssetBundle类属于UnityEngine命名空间,在下文中一共展示了AssetBundle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Decorate

        public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
        {
            go.AddComponent<global::Deco>();

            if (options.ContainsKey("heightDelta"))
                (new HeightDecorator((double)options["heightDelta"])).Decorate(go, options, assetBundle);
        }
开发者ID:ParkitectNexus,项目名称:CustomScenery,代码行数:7,代码来源:DecoDecorator.cs


示例2: AddPackage

 public static UIPackage AddPackage(AssetBundle desc, AssetBundle res, string resourceNamePrefix)
 {
     byte[] bytes = ((TextAsset)desc.mainAsset).bytes;
     if (desc != res)
         desc.Unload(true);
     return AddPackage(bytes, res, resourceNamePrefix);
 }
开发者ID:aideas,项目名称:F-N-GUI,代码行数:7,代码来源:UIPackage.cs


示例3: Decorate

 public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
 {
     if (go.GetComponent<Deco>() != null)
     {
         go.GetComponent<Deco>().defaultGridSubdivision = _subdivision;
     }
 }
开发者ID:RandomGuy0099,项目名称:tropicalBuildingsMod,代码行数:7,代码来源:GridSubdivisionDecorator.cs


示例4: CacheData

 public CacheData(object data, AssetBundle assetBundle, string assetBundleName)
 {
     this.www = data;
     this.assetBundle = assetBundle;
     this.assetBundleKey = assetBundleName;
     this.assetHashCode = LuaHelper.StringToHash(assetBundleName);
 }
开发者ID:tenvick,项目名称:hugula,代码行数:7,代码来源:Cache.cs


示例5: Decorate

 public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
 {
     if (go.GetComponent<Deco>() != null && _grid)
     {
         go.GetComponent<Deco>().buildOnGrid = _grid;
     }
 }
开发者ID:RandomGuy0099,项目名称:tropicalBuildingsMod,代码行数:7,代码来源:GridDecorator.cs


示例6: Awake

        protected virtual void Awake()
        {
            string bundlePath = EngineerGlobals.AssemblyPath;

            s_Images = AssetBundle.CreateFromFile(bundlePath + "/images");
            s_Prefabs = AssetBundle.CreateFromFile(bundlePath + "/prefabs");
        }
开发者ID:FormalRiceFarmer,项目名称:KerbalMods,代码行数:7,代码来源:AssetBundleLoader.cs


示例7: LoadAssets

 void LoadAssets(string path)
 {
     if ((System.IO.File.Exists (path) == false) || (path.EndsWith (".unity3d") == false)) {
         return;
     }
     string assetBundleName = System.IO.Path.GetFileNameWithoutExtension (path);
     var loadedAssetBundles = Resources.FindObjectsOfTypeAll<AssetBundle> ();
     foreach (var loadedAssetBundle in loadedAssetBundles) {
         if (loadedAssetBundle.name == assetBundleName) {
             loadedAssetBundle.Unload (true);
         }
     }
     if (string.IsNullOrEmpty (path) == false) {
         if (System.IO.Directory.Exists (path)) {
             return;
         }
         byte[] bytes = System.IO.File.ReadAllBytes (path);
         if (_lastSelectedAssetBundle != null) {
             _lastSelectedAssetBundle.Unload (true);
             _lastSelectedAssetBundle = null;
         }
         _lastSelectedAssetBundle = AssetBundle.CreateFromMemoryImmediate (bytes);
         if (_lastSelectedAssetBundle != null) {
             _lastSelectedAssetBundle.name = assetBundleName;
             _assets = _lastSelectedAssetBundle.LoadAllAssets ();
         }
         OrderBySize ();
     }
 }
开发者ID:satanabe1,项目名称:unibook-samples,代码行数:29,代码来源:ABFinder.cs


示例8: Decorate

        public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
        {
            CustomSize cs = go.AddComponent<CustomSize>();

            cs.minSize = 1;
            cs.maxSize = 4;
        }
开发者ID:ParkitectNexus,项目名称:Billboards,代码行数:7,代码来源:ResizeDecorator.cs


示例9: OnRecievedAssetFromServerOrCache

        public static void OnRecievedAssetFromServerOrCache(string assetName, AssetBundle bundle)
        {
            Debug.Log(assetName);
            Debug.Log(bundle);

            if (bundle == null)
            {
                Debug.Log("Recived null asset");
            }

            string groupName = AssetGroupRefences[assetName];

            AssetObject newAssetObject = AssetGroups[groupName][assetName];

            if (bundle != null)
            {
                newAssetObject.asset = bundle.mainAsset;
                newAssetObject.bundle = bundle;
            }
            else
            {
                newAssetObject.asset = null;
                newAssetObject.bundle = null;
            }

            newAssetObject.isComplete = true;
            if (assetBundleTracker != null)
            {
                assetBundleTracker.addCompletedCount(groupName);
                assetBundleTracker.CheckIsCompletedAllDownloads(groupName);
            }
            newAssetObject.CallEvent();
        }
开发者ID:SocialPlay,项目名称:KongregateAddon,代码行数:33,代码来源:BundleSystem.cs


示例10: IsDone

 public override bool IsDone()
 {
     if (this.dependences != null)
     {
         for (int i = 0; i < this.dependences.Length; ++i)
         {
             if (!ResMgr.Instance().IsLoadedAssetBundle(this.dependences[i]))
                 return false;
         }
     }
     if (this.op != null)
     {
         return this.op.isDone;
     }
     else
     {
         if (this.www.isDone)
         {
             this.assetbundle = this.www.assetBundle;
             string scene = base.SceneName.Substring(0, base.SceneName.LastIndexOf('.'));
             if (this.additive)
                 this.op = Application.LoadLevelAdditiveAsync(scene);
             else
                 this.op = Application.LoadLevelAsync(scene);
             this.www.Dispose();
             this.www = null;
         }
         return false;
     }
 }
开发者ID:Xneed,项目名称:QFramework,代码行数:30,代码来源:SceneLoader.cs


示例11: Decorate

 public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
 {
     if (go.GetComponent<Deco>() != null)
     {
         go.GetComponent<Deco>().defaultSnapToGridCenter = _snap;
     }
 }
开发者ID:RandomGuy0099,项目名称:tropicalBuildingsMod,代码行数:7,代码来源:SnapToCenterDecorator.cs


示例12: LoadFromBundle

 private UnityEngine.Object LoadFromBundle(AssetBundle bundle, string name)
 {
     #if UNITY_4_3 || UNITY_4_5 || UNITY_4_6
     return bundle.Load(name);
     #else
     return bundle.LoadAsset(name);
     #endif
 }
开发者ID:farreltr,项目名称:OneLastSunset,代码行数:8,代码来源:AssetBundleManager.cs


示例13: AssetBundleRef

			/*--------------------------------------------------*/
			/// <summary>
			/// コンストラクタ.
			/// </summary>
			/// <param name="url"> 接続先. </param>
			/// <param name="version"> バージョン. </param>
			/// <param name="crc"> チェックサム. </param>
			/*--------------------------------------------------*/
			public AssetBundleRef(string url, int version, uint crc)
			{
				this.url = url;
				this.version = version;
				this.crc = crc;
				this.status = downloadStatus.none;
				this.bundle = null;
			}
开发者ID:molpheus,项目名称:AssetBundle,代码行数:16,代码来源:AssetBundleManagerBundleLoad.cs


示例14: Decorate

		public GameObject Decorate(Dictionary<string, object> options, AssetBundle assetBundle)
		{
			var asset = UnityEngine.Object.Instantiate(assetBundle.LoadAsset((string)options["model"])) as GameObject;
			asset.gameObject.SetActive (false);
			this.Decorate (asset,options, assetBundle);
			AssetManager.Instance.registerObject (asset.gameObject.GetComponent<Product> ());
			return asset;
		}
开发者ID:pollend,项目名称:Parkitect_CustomShops_Template-depreciated-,代码行数:8,代码来源:ProductDecorator.cs


示例15: Decorate

 public void Decorate(GameObject go, Dictionary<string, object> options, AssetBundle assetBundle)
 {
     switch (_type)
     {
         case "billboard":
             (new BillboardDecorator()).Decorate(go, options, assetBundle);
             break;
     }
 }
开发者ID:ParkitectNexus,项目名称:Billboards,代码行数:9,代码来源:TypeDecorator.cs


示例16: AddAssetBundle

 public void AddAssetBundle(string bundleName, AssetBundle bundle)
 {
     if (bundles.ContainsKey(bundleName)) {
         bundles[bundleName].Increase();
     }
     else {
         bundles.Add(bundleName, new AssetReference(bundle));
     }
 }
开发者ID:damagefilter,项目名称:PlayblackCore,代码行数:9,代码来源:AssetManager.cs


示例17: Start

        protected virtual void Start()
        {
            string bundlePath = EngineerGlobals.AssemblyPath + "/AssetBundles/";

            images = AssetBundle.LoadFromFile(bundlePath + "/images");
            prefabs = AssetBundle.LoadFromFile(bundlePath + "/prefabs");

            MyLogger.Log(images);
        }
开发者ID:Gerry1135,项目名称:KerbalEngineer,代码行数:9,代码来源:AssetBundleLoader.cs


示例18: UnLoadSource

 /// <summary>
 /// 卸载资源
 /// </summary>
 /// <param name="bundle">卸载的资源</param>
 /// <param name="unload"></param>
 public static void UnLoadSource(AssetBundle bundle, bool unload)
 {
     if (bundle == null)
     {
         LCSConsole.WriteError("卸载资源为空!");
         return;
     }
     bundle.Unload(unload);
 }
开发者ID:LYXWuDao,项目名称:LYXUnityGame,代码行数:14,代码来源:LCSUnloadSource.cs


示例19: StartLoad

 //Start async load the assetbundle
 public static AsyncLoader StartLoad(AssetBundle asset, string resName , FINISH_CALLBACK finish_callback)
 {
     if(sGoInstance == null)
     {
         sGoInstance = new GameObject("AsyncLoader");
     }
     AsyncLoader loader = sGoInstance.AddComponent<AsyncLoader>();
     loader.StartCoroutine(loader.GoLoader(asset, resName,finish_callback));
     return loader;
 }
开发者ID:lingllting,项目名称:Unity3DGameResource,代码行数:11,代码来源:AsyncLoader.cs


示例20: PreviewAssetStoreAssetBundleInInspector

 public static bool PreviewAssetStoreAssetBundleInInspector(AssetBundle bundle, AssetStoreAsset info)
 {
   info.id = 0;
   info.previewAsset = bundle.mainAsset;
   AssetStoreAssetSelection.Clear();
   AssetStoreAssetSelection.AddAssetInternal(info);
   Selection.activeObject = (Object) AssetStoreAssetInspector.Instance;
   AssetStoreAssetInspector.Instance.Repaint();
   return true;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:10,代码来源:AssetStoreToolUtils.cs



注:本文中的UnityEngine.AssetBundle类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityEngine.AudioClip类代码示例发布时间:2022-05-26
下一篇:
C# UnityEngine.AnimatorStateInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap