public void SetUpgradeType(UPGRADE_TYPE type) { upgradeType = type; if (upgradeType == UPGRADE_TYPE.MONSTER) { partyInfo = PartyInfoVC.Inst; scrollList.prefabUnit = prefabPartyUnit; FrameScroll.SetActive(true); //선택된 몬스터 Data monsterData = partyInfo.MonsterList[partyInfo.selected_unit_idx]; } else//upgradeType == UPGRADE_TYPE.EQUIPMENT { equipmentInfo = EquipmentInfoManager.Inst; scrollList.prefabUnit = prefabItemUnit; FrameScroll.SetActive(false); //선택된 장비 Data equipmentData = equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][equipmentInfo.GetUnitIdx()]; InsertEquipmentUpgradeScroll(); } initScrollList(); updateView(); }
//스크롤 종류에 따른 Sort버튼 Text 업데이트 private void updateViewText() { if (PartyInfoVC.checkInst() && !SubViewEquipment.checkInst()) { PartyInfoVC party_info = PartyInfoVC.Inst; if (party_info.currentScrollType == PartyInfoVC.scroll_type.SERVANT_INFO) { textSort[0].text = "POWER"; textSort[1].text = "GRADE"; textSort[2].text = "LEVEL"; textSort[3].text = "GOT TIME"; textSort[4].text = "JOB"; } else { textSort[0].text = "POWER"; textSort[1].text = "GRADE"; textSort[2].text = "LEVEL"; textSort[3].text = "GOT TIME"; textSort[4].text = "UPGRADE"; } } else if (InventoryVC.checkInst() || SubViewEquipment.checkInst()) { textSort[0].text = "POWER"; textSort[1].text = "GRADE"; textSort[2].text = "TIER"; textSort[3].text = "GOT TIME"; textSort[4].text = "UPGRADE"; } }
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 OnClickClose() { if (PartyInfoVC.checkInst()) { PartyInfoVC.Inst.frameScroll.SetActive(true); } else if (InventoryVC.checkInst()) { InventoryVC.Inst.FrameMain.SetActive(true); } Destroy(this.gameObject); }
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 void OnClickClose() { if (PartyInfoVC.checkInst()) { if ((dType == DECONSTRUCTION_TYPE.SERVANT && partyInfo.ServantList != null) || (dType == DECONSTRUCTION_TYPE.MONSTER && partyInfo.MonsterList != null)) { PartyInfoVC.Inst.frameScroll.SetActive(true); } } else if (InventoryVC.checkInst()) { InventoryVC.Inst.FrameMain.SetActive(true); } Destroy(this.gameObject); }
//분해 완료(서버에서 응답) 후 화면 전체 갱신 public void updateViewFinishRequest() { OnClickButtonClear(); if (PartyInfoVC.checkInst()) { PartyInfoVC patyInfo = PartyInfoVC.Inst; patyInfo.setData(); patyInfo.resetScroll(); patyInfo.updateDetailInfo(patyInfo.scrollList.getFirstItemOrder()); setData(); scrollList.rectTrScrollLayer.anchoredPosition = Vector2.zero; scrollList.SetItemOrder(getOrder()); scrollList.ScrollViewDidScroll(); } else if (InventoryVC.checkInst()) { InventoryVC inventory = InventoryVC.Inst; if (inventory.FrameEquipmentInfo.activeSelf) { if (EquipmentInfoManager.checkInst()) { EquipmentInfoManager equipmentInfo = EquipmentInfoManager.Inst; equipmentInfo.setData(); if (equipmentInfo.EquipmentList[(int)equipmentInfo.selectedMenu].Count > 0) { equipmentInfo.resetScroll(); equipmentInfo.updateDetailInfo(equipmentInfo.scrollList.getFirstItemOrder()); } else { equipmentInfo.updateAllView(); } setData(); scrollList.rectTrScrollLayer.anchoredPosition = Vector2.zero; scrollList.SetItemOrder(getOrder()); scrollList.ScrollViewDidScroll(); } } } }
public void SetDeconstructionType(DECONSTRUCTION_TYPE type) { dType = type; if (dType == DECONSTRUCTION_TYPE.SERVANT || dType == DECONSTRUCTION_TYPE.MONSTER) { partyInfo = PartyInfoVC.Inst; scrollList.prefabUnit = prefabPartyUnit; } else { equipmentInfo = EquipmentInfoManager.Inst; scrollList.prefabUnit = prefabItemUnit; } initScrollList(); updateView(); }
//PartyInfo 화면에서 유닛을 선택했을때 해당 모델로 교체 public void ChangeSelectedUnitModel() { //서브뷰 상태일때는 Return; //if (SubViewDeconstruction.checkInst() || SubViewUpgrade.checkInst()) //{ // return; //} if (PartyInfoVC.checkInst()) { PartyInfoVC partyInfo = PartyInfoVC.Inst; if (objMonsterModel != null) { Destroy(objMonsterModel); } if (partyInfo.selectedMenu == PartyInfoVC.menu_type.SERVANT) { objServantModel.SetActive(false); int servant_id = partyInfo.ServantList[partyInfo.selected_unit_idx].id; characterCustom.jobIndex = CSVData.Inst.GetServantData(servant_id).job; characterCustom.headIndex = CSVData.Inst.GetServantData(servant_id).head; characterCustom.hairIndex = CSVData.Inst.GetServantData(servant_id).hair; characterCustom.isMan = CSVData.Inst.GetServantData(servant_id).gender; characterCustom.isChildren = CSVData.Inst.GetServantData(servant_id).body; characterCustom.Refresh(); objServantModel.SetActive(true); changeCameraOffsetByModelHeight(objServantModel.GetComponent <CharInfo>().Height); } else if (partyInfo.selectedMenu == PartyInfoVC.menu_type.MONSTER) { objServantModel.SetActive(false); objMonsterModel = Instantiate(Resources.Load <GameObject>("InGameCharacterPrefabs/" + CSVData.Inst.GetMonsterDBResourceModel(partyInfo.MonsterList[partyInfo.selected_unit_idx].id)), characterCustom.transform); changeCameraOffsetByModelHeight(objMonsterModel.GetComponent <CharInfo>().Height); } DebugLog.Log(false, "change update model"); } }
public void updateSlot(int unit_idx) { if (unit_idx > 0) { if (SubViewDeconstruction.Inst.GetDeconstructionType() == DECONSTRUCTION_TYPE.SERVANT || SubViewDeconstruction.Inst.GetDeconstructionType() == DECONSTRUCTION_TYPE.MONSTER) { FrameUnitInfo.SetActive(true); FrameItemInfo.SetActive(false); imageEmptySlot.enabled = false; this.GetComponent <Button>().interactable = true; PartyInfoVC party_info = PartyInfoVC.Inst; if (party_info.selectedMenu == PartyInfoVC.menu_type.SERVANT) { UserServantData s_info = UserDataManager.Inst.GetServantInfo(unit_idx); if (s_info == null) { DebugLog.Log(false, "Invalid Servant ID : " + s_info.id); } imageUnitGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)s_info.grade); imageUnit.sprite = CSVData.Inst.GetServantData(s_info.id).servantIcon; textUnitLevel.text = string.Format("{0}", s_info.level); textStr.text = string.Format("{0}", s_info.status.basicStr); textDex.text = string.Format("{0}", s_info.status.basicDex); textInt.text = string.Format("{0}", s_info.status.basicInt); } else if (party_info.selectedMenu == PartyInfoVC.menu_type.MONSTER) { UserMonsterData m_info = UserDataManager.Inst.GetMonsterInfo(unit_idx); if (m_info == null) { DebugLog.Log(false, "Invalid Monster ID : " + m_info.id); } imageUnitGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)m_info.grade); imageUnit.sprite = CSVData.Inst.GetMonsterData(m_info.id).monsterIcon; textUnitLevel.text = string.Format("{0}", m_info.level); textStr.text = string.Format("{0}", m_info.status.basicStr); textDex.text = string.Format("{0}", m_info.status.basicDex); textInt.text = string.Format("{0}", m_info.status.basicInt); } } else//Equip { FrameUnitInfo.SetActive(false); FrameItemInfo.SetActive(true); imageEmptySlot.enabled = false; this.GetComponent <Button>().interactable = true; UserEquipmentData e_info = UserDataManager.Inst.GetEquipmentInfo(unit_idx); if (e_info == null) { DebugLog.Log(false, "Invalid Equip ID : " + e_info.id); } imageItemGrade.sprite = CSVData.Inst.GetSpriteGrade((GRADE_TYPE)e_info.grade); imageItem.sprite = CSVData.Inst.GetEquipmentData(e_info.id).equipmentIcon; textItemLevel.text = string.Format("{0}", e_info.upgrade); imageStat.sprite = CSVData.Inst.GetSpriteOptionType(e_info.optionType); textStat.text = string.Format("{0}", e_info.value); } } else { this.GetComponent <Button>().interactable = false; imageEmptySlot.enabled = true; } }
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); } } }
void Start() { partyInfo = PartyInfoVC.Inst; initScrollList(); updateAllView(); }