当前位置: 首页>>代码示例>>C#>>正文


C# UnityEngine.AssetBundle类代码示例

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


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


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