public void ItemButton() { UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("GamePokey"); if (go != null) { if (!NGUITools.GetActive(go)) { ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(id); if (itemconfig != null) { EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts); if (ei != null) { go = UIManager.Instance.GetWindowGoByName("ItemProperty"); if (go != null && !NGUITools.GetActive(go)) { ItemProperty ip = go.GetComponent <ItemProperty>(); if (ip != null) { ip.Compare(ei.id, ei.level, ei.propertyid, id, ei.level, propertyid, itemconfig.m_WearParts); UIManager.Instance.ShowWindowByName("ItemProperty"); } } } } } else { UIManager.Instance.HideWindowByName("ItemProperty"); } } }
private void StoreItemClick(UnityEngine.GameObject goc) { foreach (storeInfo si in storeDic.Values) { if (si != null) { if (si.go == goc) { if (si.CanBuyTime == 0) { //已卖完 } else { //需要兑换 ArkCrossEngine.StoreConfig sc = ArkCrossEngine.StoreConfigProvider.Instance.GetDataById(si.ID); if (sc != null) { ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(sc.m_ItemId); if (itemconfig != null) { if (itemconfig.m_CanWear) { EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts); if (ei != null) { UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("ItemProperty"); if (go != null && !NGUITools.GetActive(go)) { ItemProperty ip = go.GetComponent <ItemProperty>(); if (ip != null) { ip.ExchangeGoodsCompare(currencySprite, si.ID, ei.id, ei.level, ei.propertyid, sc.m_ItemId, ei.level, ei.propertyid, itemconfig.m_WearParts, si.GetCurrency()); UIManager.Instance.ShowWindowByName("ItemProperty"); } } } } else { UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("ItemProperty"); if (go != null && !NGUITools.GetActive(go)) { ItemProperty ip = go.GetComponent <ItemProperty>(); if (ip != null) { ip.ExchangeGoodsSetItemProperty(currencySprite, si.ID, sc.m_ItemId, 0, 0, 0, si.GetCurrency()); UIManager.Instance.ShowWindowByName("ItemProperty"); } } } } } } } } } }
private void ChangeSlotState(bool show) { if (m_pos != -1) { EquipmentInfo info = GamePokeyManager.GetEquipmentInfo(m_pos); if (info != null) { UnityEngine.Transform frame = info.equipSlot.transform.Find("Frame"); if (frame != null) { NGUITools.SetActive(frame.gameObject, show); } } } }
public void OnButtonClick() { UnityEngine.GameObject gogo = UIManager.Instance.GetWindowGoByName("GamePokey"); if (gogo != null) { UnityEngine.Transform tf = gogo.transform.Find("RoleInfo"); if (tf != null) { if (NGUITools.GetActive(tf.gameObject)) { return; } } } ArkCrossEngine.ItemConfig itemconfig = ArkCrossEngine.LogicSystem.GetItemDataById(ID); if (itemconfig != null) { UnityEngine.GameObject go = UIManager.Instance.GetWindowGoByName("GamePokey"); if (go != null) { EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(itemconfig.m_WearParts); if (ei != null) { go = UIManager.Instance.GetWindowGoByName("ItemProperty"); if (go != null && !NGUITools.GetActive(go)) { ItemProperty ip = go.GetComponent <ItemProperty>(); if (ip != null) { ip.Compare(ei.id, ei.level, ei.propertyid, ID, ei.level, PropertyId, itemconfig.m_WearParts); UIManager.Instance.ShowWindowByName("ItemProperty"); } } } } } }
void SlotButtonClick(UnityEngine.GameObject go) { // UnityEngine.Transform tf = transform.Find("RoleInfo"); // if (tf != null) { // if (NGUITools.GetActive(tf.gameObject)) { // return; // } // } if (go == null) { return; } int pos = 0; switch (go.transform.name) { case "Slot0": pos = 0; break; case "Slot1": pos = 1; break; case "Slot2": pos = 2; break; case "Slot3": pos = 3; break; case "Slot4": pos = 4; break; case "Slot5": pos = 5; break; case "Slot6": //时装 pos = 6; //ShowContainer(fashionContainer); return; case "Slot7": //翅膀 pos = 7; break; //ShowContainer(wingContainer); //return; case "Slot8": //Xhun pos = 8; break; //RoleInfo roleInfo = LobbyClient.Instance.CurrentRole; //if (roleInfo != null) { // LevelLock config = LevelLockProvider.Instance.GetDataById(9); // if (config != null) { // if (config.m_Level <= roleInfo.Level) {//等级开放 // ShowContainer(xhunContainer); // } // } //} //return; default: return; } EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(pos); if (ei != null && ei.id != 0) { UnityEngine.GameObject ipgo = UIManager.Instance.GetWindowGoByName("ItemProperty"); if (ipgo != null && !NGUITools.GetActive(ipgo)) { ItemProperty ip = ipgo.GetComponent <ItemProperty>(); ItemConfig config = ItemConfigProvider.Instance.GetDataById(ei.id); ip.SetItemProperty(ei.id, pos, ei.level, ei.propertyid, false, !config.m_CanUpgrade); UIManager.Instance.HideWindowByName("EntrancePanel"); UIManager.Instance.ShowWindowByName("ItemProperty"); } } }
protected virtual void OnDragDropRelease(UnityEngine.GameObject surface) { ChangeSlotState(false); UIDragDropContainer container = surface ? NGUITools.FindInParents <UIDragDropContainer>(surface) : null; if (container != null) { if (container.reparentTarget.name == "Equipment") { ItemClick ic = mTrans.gameObject.GetComponent <ItemClick>(); if (ic != null) { if (surface != null) { ArkCrossEngine.RoleInfo roleInfo = ArkCrossEngine.LobbyClient.Instance.CurrentRole; if (roleInfo != null) { ArkCrossEngine.ItemConfig itemConfig = ArkCrossEngine.ItemConfigProvider.Instance.GetDataById(ic.ID); if (itemConfig != null) { if (itemConfig.m_WearLevel > roleInfo.Level) { string tip = ArkCrossEngine.StrDictionaryProvider.Instance.GetDictString(46); ArkCrossEngine.LogicSystem.EventChannelForGfx.Publish("ge_screen_tip", "ui", tip, UIScreenTipPosEnum.AlignCenter, new UnityEngine.Vector3(0f, 0f, 0f)); } else { int slotid = 0; string str = surface.transform.name; if (str != null) { char[] ch = str.ToCharArray(); if (ch != null && ch.Length >= 5) { if (System.Int32.TryParse(ch[4].ToString(), out slotid)) { EquipmentInfo ei = GamePokeyManager.GetEquipmentInfo(slotid); if (ei != null) { ArkCrossEngine.GfxSystem.EventChannelForLogic.Publish("ge_mount_equipment", "lobby", ic.ID, ic.PropertyId, slotid); } } } } } } } } } } } if (mDragScrollView != null) { mDragScrollView.enabled = true; } if (mCollider != null) { mCollider.enabled = true; } }