FairyGUI.UIPackage.GetItemByURL C# (CSharp) Method

GetItemByURL() public static method

public static GetItemByURL ( string url ) : PackageItem
url string
return PackageItem
        public static PackageItem GetItemByURL(string url)
        {
            if (url.Length > 13)
            {
                string pkgId = url.Substring(5, 8);
                string srcId = url.Substring(13);
                UIPackage pkg = GetById(pkgId);
                if (pkg != null)
                    return pkg.GetItem(srcId);
            }
            return null;
        }

Usage Example

Example #1
0
        /// <summary>
        ///
        /// </summary>
        protected void LoadContent()
        {
            ClearContent();

            if (string.IsNullOrEmpty(_url))
            {
                return;
            }

            _contentItem = UIPackage.GetItemByURL(_url);

            if (_contentItem != null)
            {
                _contentItem = _contentItem.getBranch();
                _contentItem = _contentItem.getHighResolution();
                _contentItem.Load();

                if (_contentItem.type == PackageItemType.Spine)
                {
#if FAIRYGUI_SPINE
                    LoadSpine();
#endif
                }
                else if (_contentItem.type == PackageItemType.DragoneBones)
                {
#if FAIRYGUI_DRAGONBONES
                    LoadDragonBones();
#endif
                }
            }
            else
            {
                LoadExternal();
            }
        }
All Usage Examples Of FairyGUI.UIPackage::GetItemByURL