void HeroClickExecute(int idx) // 영웅 버튼 클릭시 콜백 { if (!panel.gameObject.activeInHierarchy) { panel.gameObject.SetActive(true); } selectIndex = idx; AllyCharacter temp = account.Access_character(selectIndex).GetComponent <AllyCharacter>(); temp.Access_equipments = FileManager.ListDataLoad <EquipmentData>("SaveFile/UserData/" + temp.Access_prefabname + "EquipList.txt"); temp_atkpower = temp_atkspeed = temp_defpower = temp_hp = 0; for (int i = 0; i < temp.Access_equipments.Count; i++) { temp_atkpower += temp.Access_equipment(i).atkpower; temp_atkspeed += temp.Access_equipment(i).atkspeed; temp_defpower += temp.Access_equipment(i).defpower; } paneltemp_faceImage.GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/" + temp.Access_faceimage.ToString()); paneltemp_textlist.GetChild(0).GetComponent <Text>().text = temp.Access_charactername; paneltemp_textlist.GetChild(1).GetComponent <Text>().text = "LV : " + temp.Access_level.ToString() + " <color=lime> ( " + ((float)temp.Access_exp / exp_data[temp.Access_level] * 100).ToString("F1") + " % )</color>"; paneltemp_textlist.GetChild(2).GetComponent <Text>().text = "HP : " + temp.Access_maxhealthpoint + AdditionalText(temp_hp); paneltemp_textlist.GetChild(3).GetComponent <Text>().text = "공격력 : " + temp.Access_atkpower.ToString() + AdditionalText(temp_atkpower); paneltemp_textlist.GetChild(4).GetComponent <Text>().text = "공격속도 : " + temp.Access_atkspeed.ToString("F2") + AdditionalText(temp_atkspeed); paneltemp_textlist.GetChild(5).GetComponent <Text>().text = "방어력 : " + temp.Access_defpower.ToString() + AdditionalText(temp_defpower); skill_image.GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/skillImage" + temp.Access_skillimage.ToString()); skill_manual.GetComponent <Text>().text = temp.Access_skillname + "\n" + ((Skill)temp.GetComponent(temp.Access_skillname)).Access_skill_manual; paneltemp_equipment.GetChild(0).GetChild(0).GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/" + temp.Access_equipment(0).equipmentname); paneltemp_equipment.GetChild(1).GetChild(0).GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/" + temp.Access_equipment(1).equipmentname); paneltemp_equipment.GetChild(2).GetChild(0).GetComponent <Image>().overrideSprite = Resources.Load <Sprite>("Sprite/" + temp.Access_equipment(2).equipmentname); }
} // 클래스에 따른 장비 선택 분류 메소드 void ClickEquipmentOnInventory(int param_maintype, int param_idx, AllyCharacter param_character) // 인벤토리 창에서 장비를 선택했을 때 콜백 { templist = FileManager.ListDataLoad <EquipmentData>("SaveFile/InventoryData/InventoryItemList.txt"); // 인벤토리 아이템 리스트 로드 for (int i = 0; i < templist.Count; i++) { if (templist[i].isMounted && templist[i].whoMounted == param_character.Access_charactername && templist[i].maintype == (EquipmentMainType)param_maintype) { templist[i].isMounted = false; } } templist[param_idx].isMounted = true; templist[param_idx].whoMounted = param_character.Access_charactername; param_character.Access_equipment(param_maintype, templist[param_idx]); FileManager.ListDataGenerate <EquipmentData>("SaveFile/InventoryData/InventoryItemList.txt", templist); templist2 = FileManager.ListDataLoad <EquipmentData>("SaveFile/UserData/" + param_character.Access_prefabname + "EquipList.txt"); // 캐릭터 아이템 리스트 로드 templist2[param_maintype] = templist[param_idx]; FileManager.ListDataGenerate <EquipmentData>("SaveFile/UserData/" + param_character.Access_prefabname + "EquipList.txt", templist2); for (int i = 0; i < InventoryWindow_itemlist.childCount; i++) { InventoryWindow_itemlist.GetChild(i).gameObject.SetActive(false); } InventoryWindow.gameObject.SetActive(false); HeroClickExecute(selectIndex); }