예제 #1
0
 public List <ItemInfo> GetReqItemList()
 {
     if (reqItemList == null)
     {
         reqItemList = new List <ItemInfo>();
         ItemInfo vo = null;
         if (CostItem1 > 0)
         {
             vo             = ItemLocator.GetInstance().GetItemVO(CostItem1, ItemConstant.TYPE_OTHER);
             vo.MaxStackNum = CostItemNum1;
             reqItemList.Add(vo);
         }
         if (CostItem2 > 0)
         {
             vo             = ItemLocator.GetInstance().GetItemVO(CostItem2, ItemConstant.TYPE_OTHER);
             vo.MaxStackNum = CostItemNum2;
             reqItemList.Add(vo);
         }
         if (CostItem3 > 0)
         {
             vo             = ItemLocator.GetInstance().GetItemVO(CostItem3, ItemConstant.TYPE_OTHER);
             vo.MaxStackNum = CostItemNum3;
             reqItemList.Add(vo);
         }
     }
     return(reqItemList);
 }
예제 #2
0
 void SwitchWeapon(uint id)
 {
     if (id == 0)
     {
         id = Owner.heroSetting.DefaultWeapon;
     }
     if (equipInfor != null && equipInfor.ID == id)
     {
         return;
     }
     equipInfor = ItemLocator.GetInstance().GetEquip((int)id);
     if (equipInfor == null)
     {
         Debug.LogError("武器 " + id + "不存在");
         return;
     }
     if (equipInfor.FBX.Length == 0)
     {
         Debug.LogError("武器 " + id + "没填写FBX数据");
         return;
     }
     GameObject.Destroy(Owner.property.weapon[0]);
     GameObject.Destroy(Owner.property.weapon[1]);
     Owner.property.weapon[0] = null;
     Owner.property.weapon[1] = null;
     assetInfo = AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + equipInfor.FBX);
     if (equipInfor.Fx.Length > 0)
     {
         fxInfo = AssetLoader.GetInstance().Load(URLUtil.GetResourceLibPath() + equipInfor.Fx);
     }
 }
예제 #3
0
 public CacheManager(string className, ItemLocator itemLocator, ItemIdentifier itemIdentifier, CacheDurability durability)
 {
     this.className      = className;
     this.itemLocator    = itemLocator;
     this.itemIdentifier = itemIdentifier;
     this.durability     = durability;
     Log(className, CacheLogType.EmptyCacheStarted, durability.ToString());
 }
예제 #4
0
        private void ShowAward(RemoteTable award)
        {
            int nMoney = award["nMoney"];
            int nExp   = award["nExp"];

            MoneyLabel.text = nMoney.ToString();
            ExpLabel.text   = nExp.ToString();

            RemoteTable ItemTypes  = (RemoteTable)award["ItemTypes"];
            RemoteTable ItemIndexs = (RemoteTable)award["ItemIndexs"];
            RemoteTable ItemAmouts = (RemoteTable)award["ItemAmouts"];

            for (int i = 0; i < 5; i++)
            {
                Items[i].gameObject.SetActive(false);
                ItemNum[i].gameObject.SetActive(false);
            }

            for (int i = 0; i < 3; i++)
            {
                Stars[i].gameObject.SetActive(false);
            }

            int nCount = ItemTypes.dictKV.Count;

            for (int i = 1; i <= nCount; i++)
            {
                int nItemType   = ItemTypes[i];
                int nItemIndex  = ItemIndexs[i];
                int nItemAmouts = ItemAmouts[i];

                UIAtlas atlas = UIAtlasManager.GetInstance().GetUIAtlas("IconAtlas");
                Items[i - 1].atlas = atlas;
                ItemInfo itemVO = ItemLocator.GetInstance().GetItemVO(nItemIndex, (byte)nItemType);
                Items[i - 1].gameObject.SetActive(true);
                Items[i - 1].spriteName = itemVO.Icon;
                ItemNum[i - 1].gameObject.SetActive(true);
                ItemNum[i - 1].text = "X" + nItemAmouts;
            }

            BlackBGSprite.gameObject.transform.localScale = new Vector3(3, 3, 3);
        }
예제 #5
0
        private void SetNeedMaterialData()
        {
            string itemName  = "";
            int    itemCount = 0;

            if (ReadStepTab().nItemIndex != 0)
            {
                KTabLineItem otherItem = ItemLocator.GetInstance().GetOtherItem(ReadStepTab().nItemIndex);
                itemName  = otherItem.Name;
                itemCount = ReadStepTab().nItemCount;
            }
            ItemInfo info;

            info = GetGoodFormBag(itemName);
            if (info != null)
            {
                ui.SetNeedMaterialData(itemName, itemCount, info.Name, info.CurNum);
            }
            else
            {
                ui.SetNeedMaterialData(itemName, itemCount, itemName, 0);
            }
        }
예제 #6
0
 private static void UpdateCollectionOnRepositoryChange <T, TKey, TTarget>(IList <TTarget> collection, ItemLocator <T, TTarget> locator, RepositoryChangeEventArgs <T> e, TTarget target) where T : IUniqueObject <TKey>
 {
     if (e.OperationType == OperationType.Add)
     {
         collection.Add(target);
     }
     else
     {
         var original = locator(e.Item);
         if (e.OperationType == OperationType.Edit)
         {
             collection.Update(target, p => p.Equals(original));
         }
         else if (e.OperationType == OperationType.Delete)
         {
             collection.Remove(original);
         }
     }
 }
예제 #7
0
        /// <summary>
        /// Updates the collection base on the operation type
        /// </summary>
        public static void BindToRepositoryChangesAsync <T, TKey, TTarget>(this IList <TTarget> collection, ICRUDRepository <T, TKey> repo, Projection <T, Task <TTarget> > porjection, ItemLocator <T, TTarget> locator)
            where T : IUniqueObject <TKey>
        {
            repo.ItemsChanged += async(s, e) =>
            {
                var target = await porjection(e.Item);

                UpdateCollectionOnRepositoryChange <T, TKey, TTarget>(collection, locator, e, target);
            };
        }
        private object OnEquipChange(params object[] objs)
        {
            uint[] equipIDs = null;
            if (objs.Length >= 1)
            {
                equipIDs       = (uint[])objs[0];
                Owner.EquipIDs = equipIDs;
            }
            else
            {
                equipIDs = new uint[16];
            }

            string moduleID = "01";
            string str      = "";

            str += Owner.property.roleType;
            str += "|face|" + Owner.property.roleType + "_" + moduleID + "_face";

            int equ_num = 1;

            for (int i = 0; i < equipIDs.Length; ++i)
            {
                if (ItemConstant.ROLE_CATEGORY_NAME[i] != "")
                {
                    /*if (ItemConstant.ROLE_CATEGORY_NAME[i].CompareTo("pad") == 0 &&  Owner.property.roleType.CompareTo("p3")==0)
                     * {
                     *      reducing = true;
                     *      continue;
                     * }*/
                    equ_num++;
                    if (equipIDs[i] == 0)
                    {
                        str += "|" + ItemConstant.ROLE_CATEGORY_NAME[i] + "|" + Owner.property.roleType + "_" + moduleID + "_" + ItemConstant.ROLE_CATEGORY_NAME[i];
                    }
                    else
                    {
                        KTabLineEquip    item     = ItemLocator.GetInstance().GetEquip((int)equipIDs[i]);
                        KTabLineShowInfo showInfo = ItemLocator.GetInstance().GetEquipShowInfo(item.ShowID);
                        if (showInfo != null)
                        {
                            str += "|" + ItemConstant.ROLE_CATEGORY_NAME[i] + "|" + Owner.property.roleType + "_" + showInfo.OrderNumber + "_" + showInfo.Category;
                        }
                    }
                }
            }
            if (Owner.property.roleType.CompareTo("p4") == 0)
            {
                equ_num++;
                str += "|lianzi|" + Owner.property.roleType + "_" + moduleID + "_lianzi";
                equ_num++;
                str += "|lianzi001|" + Owner.property.roleType + "_" + moduleID + "_lianzi001";
            }
            generator.PrepareConfig(str);
            generator.LoadConfigComplete += CheckModelIsLoaded;
            generator.LoadConfig(equ_num, Owner.Loader);
            if (IntensifyLogic.GetInstance().GetIntensifyUI() != null && IntensifyLogic.GetInstance().GetIntensifyUI().isOpen())
            {
                IntensifyLogic.GetInstance().UpdataIntensify(0, true);
            }
            return(null);
        }
예제 #9
0
 public CacheManager(string className, ItemLocator itemLocator, ItemIdentifier itemIdentifier)
     : this(className, itemLocator, itemIdentifier, CacheDurability.Moderate)
 {
 }