void OnItemClick(GameObject obj) { if (OnClickCallBack != null) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Forge_Click"); ForgingPanelManager.GetInstance().CloseSelectPanel(); OnClickCallBack(this); } }
public static ForgingPanelManager GetInstance() { if (!instance) { instance = (ForgingPanelManager)GameObject.FindObjectOfType(typeof(ForgingPanelManager)); if (!instance) { Debug.LogError("没有附加JewelBesetManager脚本的gameobject在场景中"); } } return(instance); }
public void ItemSelectedEventHandle(ForgingListItem selectedEquipItem) { // //所有项LoseFocus if (ForgingPanelManager.GetInstance().CurrentData != selectedEquipItem.ForgeRecipeItem) { //SelectedItemList.Clear(); ItemList.ApplyAllItem(p => p.OnLoseFocus()); selectedEquipItem.OnGetFocus(); SelectedItem = selectedEquipItem; ForgingPanelManager.GetInstance().CurrentData = selectedEquipItem.ForgeRecipeItem; ForgingPanelManager.GetInstance().Sc_ForgingResult.InitForgResult(selectedEquipItem.ForgeRecipeItem); } ForgingPanelManager.GetInstance().CheckButtonEff(); }
private IEnumerator St_InitListItem() { // ItemTable.transform.ClearChild(); ItemList.ApplyAllItem(c => c.gameObject.SetActive(false)); InitItemFileinfoList(); if (ForgeRecipeDataList.Count > 0) { // if(ForgeRecipeDataList.Count>=4) // { for (int i = 0; i < ForgeRecipeDataList.Count; i++) { if (ItemList.Count > i) { ItemList[i].gameObject.SetActive(true); ItemList[i].InitItemData(ForgeRecipeDataList[i]); } else { Item_go = NGUITools.AddChild(ItemTable.gameObject, FriendListItemPrefab); Item_go.name = FriendListItemPrefab.name + i; Item_go.RegisterBtnMappingId(ForgeRecipeDataList[i].ForgeID, UI.MainUI.UIType.Forging, BtnMapId_Sub.Forging_ForgingItem); Item_go.AddComponent <UIDragPanelContents>(); ForgingListItem Sc_item = Item_go.GetComponent <ForgingListItem>(); Sc_item.InitItemData(ForgeRecipeDataList[i]); Sc_item.OnClickCallBack = ItemSelectedEventHandle; ItemList.Add(Sc_item); } } if (ForgingPanelManager.GetInstance().CurrentForingType == CurrentListType) { if (SelectedItem != null) { SelectedItem.BeSelected(); } else { ItemList[0].BeSelected(); } } else { ItemList[0].BeSelected(); } CurrentListType = ForgingPanelManager.GetInstance().CurrentForingType; yield return(null); ItemTable.Reposition(); m_dragPanelComp.ResetPosition(); // yield return null; //如果有引导箭头,不允许拖动 if (HasGuideArrow) { m_dragPanelComp.LockDraggable = true; } else { m_dragPanelComp.LockDraggable = false; } } else { } }
void InitItemFileinfoList() { int vocation = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PlayerCommonValue.PLAYER_FIELD_VISIBLE_VOCATION; ForgeRecipeDataList = ForgingRecipeConfigDataManager.Instance.ForgeRecipeDataList(ForgingPanelManager.GetInstance().CurrentForingType).Where(p => p.ForgeProfession.LocalContains(vocation)).ToList(); }
void OnDestroy() { instance = null; UIEventManager.Instance.RemoveUIEventHandel(UIEventType.Forging, ForgingComHandle); }