public void updateSelectedUnitInfo() { if (selected_unit_idx < 0 || selected_unit_idx >= total_item_num) { DebugLog.Log(false, "Invalid select_unit_idx by scrollmove select"); return; } if (LobbyManager.Inst.popupState == POPUP_STATE.Servant) { bool none_subview = true; if (SubViewDeconstruction.checkInst() || SubViewEquipment.checkInst() || SubViewUpgrade.checkInst()) { none_subview = false; } if (PartyInfoVC.checkInst() && none_subview) { PartyInfoVC partyInfo = PartyInfoVC.Inst; if (partyInfo.selectedMenu == PartyInfoVC.menu_type.SERVANT || partyInfo.selectedMenu == PartyInfoVC.menu_type.MONSTER) { if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO || partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO) { partyInfo.updateDetailInfo(selected_main_idx); } } } } else if (LobbyManager.Inst.popupState == POPUP_STATE.Weapon) { if (InventoryVC.checkInst()) { if (InventoryVC.Inst.selectedMenu == Inventory_Menu_Type.ITEM) { if (ItemInfoManager.Inst.ItemList.Count > 0) { ItemInfoManager.Inst.updateItemDetailInfo(selected_main_idx); } } else { bool none_subview = true; if (SubViewDeconstruction.checkInst() || SubViewEquipment.checkInst() || SubViewUpgrade.checkInst()) { none_subview = false; } if (InventoryVC.checkInst() && none_subview) { if (EquipmentInfoManager.Inst.EquipmentList[(int)EquipmentInfoManager.Inst.GetSelectedMenu()].Count > 0) { EquipmentInfoManager.Inst.updateDetailInfo(selected_main_idx); } } } } } }
public void OnClickSortType(int btn_idx) { sortType = (SORT_TYPE)btn_idx; updateSortView(); if (PartyInfoVC.checkInst()) { if (SubViewEquipment.checkInst()) { DebugLog.Log(false, "Reset Equip List"); SubViewEquipment.Inst.ResetScrollListBySortType(sortType); } else if (SubViewDeconstruction.checkInst()) { DebugLog.Log(false, "Reset deconstruct List"); SubViewDeconstruction.Inst.ResetScrollListBySortType(sortType); } else if (SubViewUpgrade.checkInst()) { DebugLog.Log(false, "Reset SubViewUpgrade List"); SubViewUpgrade.Inst.ResetScrollListBySortType(sortType); } else { DebugLog.Log(false, "Reset Partyinfo List"); PartyInfoVC.Inst.ResetScrollListBySortType(sortType); } } else if (InventoryVC.checkInst()) { if (SubViewDeconstruction.checkInst()) { DebugLog.Log(false, "Reset deconstruct List"); SubViewDeconstruction.Inst.ResetScrollListBySortType(sortType); } else if (SubViewUpgrade.checkInst()) { DebugLog.Log(false, "Reset SubViewUpgrade List"); SubViewUpgrade.Inst.ResetScrollListBySortType(sortType); } else { DebugLog.Log(false, "Reset Inven List"); EquipmentInfoManager.Inst.ResetScrollListBySortType(sortType); } } }
public override void OnClickUnit() { if (LobbyManager.Inst.popupState == POPUP_STATE.Servant) { SubViewEquipment.Inst.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); SubViewEquipment.Inst.updateChangeItemInfo(main_idx); } else if (LobbyManager.Inst.popupState == POPUP_STATE.Weapon) { if (!SubViewDeconstruction.checkInst()) { equipmentInfo.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); equipmentInfo.updateDetailInfo(main_idx); } else { SubViewDeconstruction subview_deconstruction = SubViewDeconstruction.Inst; subview_deconstruction.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); int item_unit_idx = 0; item_unit_idx = equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][subview_deconstruction.scrollListData[main_idx]].index; if (subview_deconstruction.checkInsertMax()) { DebugLog.Log(false, "Warning : 분해 슬롯 최대치!"); SimpleErrorPopupVC.Inst.UpdateErrorText("Max Burn List"); } else { if (subview_deconstruction.checkInsertedUnit(item_unit_idx)) { DebugLog.Log(false, "Warning : 이미 분해 슬롯에 등록된 유닛 입니다."); SimpleErrorPopupVC.Inst.UpdateErrorText("Already Listed"); } else { GetComponent <Button>().interactable = false; imageDisable.SetActive(true); SubViewDeconstruction.Inst.InsertUnit(item_unit_idx); } } } } }
public override void UpdateUnit(int _main_idx) { main_idx = _main_idx; if (LobbyManager.Inst.popupState == POPUP_STATE.Servant) { ImageGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)SubViewEquipment.Inst.EquipmentList[main_idx].grade); imageItem.sprite = CSVData.Inst.GetEquipmentData(SubViewEquipment.Inst.EquipmentList[main_idx].id).equipmentIcon; textItemName.text = CSVData.Inst.GetEquipmentData(SubViewEquipment.Inst.EquipmentList[main_idx].id).name; string upgrade = string.Format(" "); if (SubViewEquipment.Inst.EquipmentList[main_idx].upgrade > 0) { upgrade = string.Format("+{0}", SubViewEquipment.Inst.EquipmentList[main_idx].upgrade); } textUpgrade.text = upgrade; imageStats.sprite = CSVData.Inst.GetSpriteOptionType(SubViewEquipment.Inst.EquipmentList[main_idx].optionType); textStats.text = string.Format("{0}", SubViewEquipment.Inst.EquipmentList[main_idx].value); } else if (LobbyManager.Inst.popupState == POPUP_STATE.Weapon) { int selected_idx; if (SubViewDeconstruction.checkInst() && unit_controller.Equals(SubViewDeconstruction.Inst)) { selected_idx = SubViewDeconstruction.Inst.scrollListData[main_idx]; } else { selected_idx = main_idx; } equipmentInfo = EquipmentInfoManager.Inst; //Todo :set Image ImageGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].grade); imageItem.sprite = CSVData.Inst.GetEquipmentData(equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].id).equipmentIcon; textItemName.text = CSVData.Inst.GetEquipmentData(equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].id).name; string upgrade = string.Format(" "); if (equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].upgrade > 0) { upgrade = string.Format("+{0}", equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].upgrade); } textUpgrade.text = upgrade; imageStats.sprite = CSVData.Inst.GetSpriteOptionType(equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].optionType); textStats.text = string.Format("{0}", equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][selected_idx].value); if (SubViewDeconstruction.checkInst()) { if (unit_controller.Equals(SubViewDeconstruction.Inst)) { int chracter_unit_idx = equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][SubViewDeconstruction.Inst.scrollListData[main_idx]].index; if (SubViewDeconstruction.Inst.checkInsertedUnit(chracter_unit_idx)) { GetComponent <Button>().interactable = false; imageDisable.SetActive(true); } else { GetComponent <Button>().interactable = true; imageDisable.SetActive(false); } } } } }
public override void UpdateUnit(int _main_idx) { main_idx = _main_idx; partyInfo = PartyInfoVC.Inst; int chracter_unit_idx = 0; //Todo :set Image if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO) { int selected_idx; if (SubViewDeconstruction.checkInst() && unit_controller.Equals(SubViewDeconstruction.Inst)) { selected_idx = SubViewDeconstruction.Inst.scrollListData[main_idx]; chracter_unit_idx = partyInfo.ServantList[SubViewDeconstruction.Inst.scrollListData[main_idx]].index; } else { selected_idx = main_idx; chracter_unit_idx = partyInfo.ServantList[main_idx].index; } ImageGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)partyInfo.ServantList[selected_idx].grade); imageCharacter.sprite = CSVData.Inst.GetServantData(partyInfo.ServantList[selected_idx].id).servantIcon; textCharacterName.text = CSVData.Inst.GetServantData(partyInfo.ServantList[selected_idx].id).name; textLevel.text = string.Format("{0}", partyInfo.ServantList[selected_idx].level); textPower.text = string.Format("{0}", Calculator.GetPower(partyInfo.ServantList[selected_idx].status, partyInfo.ServantList[selected_idx].level)); textUpgrade.text = string.Format(" "); imageClass.sprite = CSVData.Inst.GetSpriteServantJob(partyInfo.ServantList[selected_idx].jobType); imageType.gameObject.SetActive(false); //TODO:나중에 파티가 여러개일 경우, 수정이 필요할 수 있음 if (partyInfo.ServantList[selected_idx].partyIndex > 0) { GetComponent <Image>().color = Color.cyan; } else { GetComponent <Image>().color = Color.white; } } else if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO) { int selected_idx; if (SubViewUpgrade.checkInst() && unit_controller.Equals(SubViewUpgrade.Inst)) { selected_idx = SubViewUpgrade.Inst.scrollListData[main_idx]; } else if (SubViewDeconstruction.checkInst() && unit_controller.Equals(SubViewDeconstruction.Inst)) { selected_idx = SubViewDeconstruction.Inst.scrollListData[main_idx]; chracter_unit_idx = partyInfo.MonsterList[SubViewDeconstruction.Inst.scrollListData[main_idx]].index; } else { selected_idx = main_idx; chracter_unit_idx = partyInfo.MonsterList[main_idx].index; } ImageGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)partyInfo.MonsterList[selected_idx].grade); imageCharacter.sprite = CSVData.Inst.GetMonsterData(partyInfo.MonsterList[selected_idx].id).monsterIcon; textCharacterName.text = CSVData.Inst.GetMonsterData(partyInfo.MonsterList[selected_idx].id).name; textLevel.text = string.Format("{0}", partyInfo.MonsterList[selected_idx].level); textPower.text = string.Format("{0}", Calculator.GetPower(partyInfo.MonsterList[selected_idx].status, partyInfo.MonsterList[selected_idx].level)); string upgrade = string.Format(" "); if (partyInfo.MonsterList[selected_idx].upgrade > 0) { upgrade = string.Format("+{0}", partyInfo.MonsterList[selected_idx].upgrade); } textUpgrade.text = upgrade; imageClass.sprite = CSVData.Inst.GetSmallSpriteTribeType(partyInfo.MonsterList[selected_idx].tribeType); imageType.gameObject.SetActive(true); imageType.sprite = CSVData.Inst.GetSpriteElementType(partyInfo.MonsterList[selected_idx].elementType); //TODO:나중에 파티가 여러개일 경우, 수정이 필요할 수 있음 if (partyInfo.MonsterList[selected_idx].partyIndex > 0) { GetComponent <Image>().color = Color.cyan; } else { GetComponent <Image>().color = Color.white; } } if (partyInfo.selectedMenu == PartyInfoVC.menu_type.FORMATION && chracter_unit_idx != 0) { if (partyInfo.checkSetFormationUnit(chracter_unit_idx)) { GetComponent <Image>().color = Color.cyan; } else { GetComponent <Image>().color = Color.white; } } if (SubViewDeconstruction.checkInst()) { if (SubViewDeconstruction.Inst.checkInsertedUnit(chracter_unit_idx)) { GetComponent <Button>().interactable = false; imageDisable.SetActive(true); } else { GetComponent <Button>().interactable = true; imageDisable.SetActive(false); } } }
public override void OnClickUnit() { if (partyInfo != null) { if (SubViewDeconstruction.checkInst()) { SubViewDeconstruction subview_deconstruction = SubViewDeconstruction.Inst; subview_deconstruction.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); int chracter_unit_idx = 0; if (subview_deconstruction.GetDeconstructionType() == DECONSTRUCTION_TYPE.SERVANT) { chracter_unit_idx = partyInfo.ServantList[subview_deconstruction.scrollListData[main_idx]].index; } else if (subview_deconstruction.GetDeconstructionType() == DECONSTRUCTION_TYPE.MONSTER) { chracter_unit_idx = partyInfo.MonsterList[subview_deconstruction.scrollListData[main_idx]].index; } if (subview_deconstruction.checkInsertMax()) { DebugLog.Log(false, "Warning : 분해 슬롯 최대치!"); SimpleErrorPopupVC.Inst.UpdateErrorText("Max Burn List"); } else { if (subview_deconstruction.checkInsertedUnit(chracter_unit_idx)) { DebugLog.Log(false, "Warning : 이미 분해 슬롯에 등록된 유닛 입니다."); SimpleErrorPopupVC.Inst.UpdateErrorText("Already Listed"); } else { GetComponent <Button>().interactable = false; imageDisable.SetActive(true); SubViewDeconstruction.Inst.InsertUnit(chracter_unit_idx); } } } else if (SubViewUpgrade.checkInst()) { SubViewUpgrade.Inst.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); int selected_unit_idx = partyInfo.MonsterList[SubViewUpgrade.Inst.scrollListData[main_idx]].index; SubViewUpgrade.Inst.InsertUnit(selected_unit_idx); } else { partyInfo.scrollList.MoveScrollSelectedUnit(this.RectTr.anchoredPosition, main_idx); if (partyInfo.selectedMenu == PartyInfoVC.menu_type.SERVANT || partyInfo.selectedMenu == PartyInfoVC.menu_type.MONSTER) { partyInfo.updateDetailInfo(getUnitIdx()); } else if (partyInfo.selectedMenu == PartyInfoVC.menu_type.FORMATION) { int chracter_unit_idx = 0; if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO) { chracter_unit_idx = partyInfo.ServantList[main_idx].index; } else if (partyInfo.currentScrollType == PartyInfoVC.scroll_type.MONSTER_INFO) { chracter_unit_idx = partyInfo.MonsterList[main_idx].index; } partyInfo.InsertUnit(chracter_unit_idx); } } } }