Create() private method

private Create ( string desc, AssetBundle res, string mainAssetName ) : void
desc string
res UnityEngine.AssetBundle
mainAssetName string
return void
コード例 #1
0
		public static UIPackage AddPackage(string assetPath, UIPackage.LoadResource loadFunc)
		{
			if (_packageInstById.ContainsKey(assetPath))
				return _packageInstById[assetPath];

			TextAsset asset = (TextAsset)loadFunc(assetPath, ".bytes", typeof(TextAsset));
			if (asset == null)
			{
				if (Application.isPlaying)
					throw new Exception("FairyGUI: Cannot load ui package in '" + assetPath + "'");
				else
					Debug.LogWarning("FairyGUI: Cannot load ui package in '" + assetPath + "'");
			}

			UIPackage pkg = new UIPackage();
			pkg._loadFunc = loadFunc;
			pkg.Create(asset.text, null, assetPath);
			if (_packageInstById.ContainsKey(pkg.id))
				Debug.LogWarning("FairyGUI: Package id conflicts, '" + pkg.name + "' and '" + _packageInstById[pkg.id].name + "'");
			_packageInstById[pkg.id] = pkg;
			_packageInstByName[pkg.name] = pkg;
			_packageInstById[assetPath] = pkg;
			_packageList.Add(pkg);
			pkg.assetPath = assetPath;

			return pkg;
		}
コード例 #2
0
		/// <summary>
		/// Add a UI package from a description text and a assetbundle, with a optional main asset name.
		/// </summary>
		/// <param name="desc">Description text.</param>
		/// <param name="res">A assetbundle contains resources.</param>
		/// <param name="mainAssetName">Main asset name.</param>
		/// <returns>UIPackage</returns>
		public static UIPackage AddPackage(string desc, AssetBundle res, string mainAssetName)
		{
			UIPackage pkg = new UIPackage();
			pkg.Create(desc, res, mainAssetName);
			_packageInstById[pkg.id] = pkg;
			_packageInstByName[pkg.name] = pkg;
			_packageList.Add(pkg);
			return pkg;
		}
コード例 #3
0
        public static UIPackage AddPackage(byte[] desc, AssetBundle res, string resourceNamePrefix)
        {
            UIPackage pkg = new UIPackage();

            pkg.Create(desc, res, resourceNamePrefix);
            _packageInstById[pkg.id]     = pkg;
            _packageInstByName[pkg.name] = pkg;
            return(pkg);
        }
コード例 #4
0
        public static UIPackage AddPackage(string descFilePath)
        {
            UIPackage pkg = new UIPackage();

            pkg.Create(descFilePath);
            _packageInstById[pkg.id]     = pkg;
            _packageInstByName[pkg.name] = pkg;
            pkg.customId = descFilePath;

            return(pkg);
        }
コード例 #5
0
ファイル: UIPackage.cs プロジェクト: yinlei/Fishing
        public static UIPackage AddPackage(string assetPath, UIPackage.LoadResource loadFunc)
        {
            if (_packageInstById.ContainsKey(assetPath))
                return _packageInstById[assetPath];

            TextAsset asset = (TextAsset)loadFunc(assetPath, ".bytes", typeof(TextAsset));
            if (asset == null)
            {
                if (Application.isPlaying)
                    throw new Exception("FairyGUI: Cannot load ui package in '" + assetPath + "'");
                else
                    Debug.LogWarning("FairyGUI: Cannot load ui package in '" + assetPath + "'");
            }

            UIPackage pkg = new UIPackage();
            pkg._loadFunc = loadFunc;
            pkg.Create(asset.text, null, assetPath);
            _packageInstById[pkg.id] = pkg;
            _packageInstByName[pkg.name] = pkg;
            _packageInstById[assetPath] = pkg;
            _packageList.Add(pkg);
            pkg.assetPath = assetPath;

            return pkg;
        }
コード例 #6
0
ファイル: UIPackage.cs プロジェクト: yinlei/Fishing
 /// <summary>
 /// Add a UI package from a description text and a assetbundle, with a optional main asset name.
 /// </summary>
 /// <param name="desc">Description text.</param>
 /// <param name="res">A assetbundle contains resources.</param>
 /// <param name="mainAssetName">Main asset name.</param>
 /// <returns>UIPackage</returns>
 public static UIPackage AddPackage(string desc, AssetBundle res, string mainAssetName)
 {
     UIPackage pkg = new UIPackage();
     pkg.Create(desc, res, mainAssetName);
     _packageInstById[pkg.id] = pkg;
     _packageInstByName[pkg.name] = pkg;
     _packageList.Add(pkg);
     return pkg;
 }
コード例 #7
0
ファイル: UIPackage.cs プロジェクト: aideas/F-N-GUI
        public static UIPackage AddPackage(string descFilePath)
        {
            UIPackage pkg = new UIPackage();
            pkg.Create(descFilePath);
            _packageInstById[pkg.id] = pkg;
            _packageInstByName[pkg.name] = pkg;
            pkg.customId = descFilePath;

            return pkg;
        }
コード例 #8
0
ファイル: UIPackage.cs プロジェクト: aideas/F-N-GUI
 public static UIPackage AddPackage(byte[] desc, AssetBundle res, string resourceNamePrefix)
 {
     UIPackage pkg = new UIPackage();
     pkg.Create(desc, res, resourceNamePrefix);
     _packageInstById[pkg.id] = pkg;
     _packageInstByName[pkg.name] = pkg;
     return pkg;
 }