當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。