private void PresentActiveSkill(ProgrammerAbility ability) { RemoveExistingSkillCell(); foreach (var activeSkill in ability.AcquiredActiveSkills.Where(skill => skill.Information.Type != SkillType.None) .OrderBy(skill => skill.Information.Name)) { var createdCell = Instantiate(skillCellTemplate, skillCellPanelTransform); var skillImage = createdCell.GetComponentInChildren <Image>(); skillImage.sprite = ResourceLoadUtility.LoadIcon(activeSkill.Information.IconName); var skillText = createdCell.GetComponentInChildren <Text>(); int allMaximumLevel = activeSkill.FlattenContainingPassiveSkills() .Aggregate(activeSkill.Information.MaximumLevel, (totalMaximumLevel, passiveSkill) => totalMaximumLevel + passiveSkill.Information.MaximumLevel); int allAcquiredLevel = activeSkill.FlattenContainingPassiveSkills() .Aggregate(activeSkill.Information.AcquisitionLevel, (totalAcquiredLevel, passiveSkill) => totalAcquiredLevel + passiveSkill.Information.AcquisitionLevel); skillText.text = string.Format("{0} ({1} / {2})", activeSkill.Information.Name, allAcquiredLevel, allMaximumLevel); var upgradeButton = createdCell.GetComponentInChildren <Button>(); upgradeButton.onClick.AddListener(() => { onUpgradeClicked.Invoke(); skillManagementPresenter.Present(activeSkill); }); } }
private void SetCellUi(GameObject cellObject, ProgrammerSpec spec) { var cellImage = cellObject.GetComponentInChildren <Image>(); cellImage.sprite = ResourceLoadUtility.LoadPortrait(spec.Status.PortraitName); cellImage.enabled = true; }
public void UpdateProject(GameStage stage, bool isFirst, bool isLast) { projectTitleText.text = stage.Title; elapsedDayText.text = stage.ElapsedDayLimit.ToString(); payText.text = stage.Reward.ToString(); icon.sprite = ResourceLoadUtility.LoadIcon(stage.IconName); if (isFirst) { previousProject.gameObject.SetActive(false); } else { previousProject.gameObject.SetActive(true); } if (isLast) { nextProject.gameObject.SetActive(false); } else { nextProject.gameObject.SetActive(true); } recommendedSkillList.Present(); }
private void PresentProgrammerInformation(ProgrammerSpec spec) { nameText.text = spec.Status.Name; portraitImage.sprite = ResourceLoadUtility.LoadPortrait(spec.Status.PortraitName); informationTexts[0].text = string.Format("정신력 : {0} / {1}", spec.Status.Health, spec.Status.FullHealth); informationTexts[1].text = string.Format("리더쉽 : {0}", spec.Status.Leadership); informationTexts[2].text = string.Format("사교성 : {0}", spec.Status.Sociality); }
public void Present(ActiveSkill activeSkill) { ClearPanel(activeSkillParentTransform); ClearPanel(passiveSkillParentTransform); ClearPanel(auxPassiveSkillParentTransform); skillIconImage.sprite = ResourceLoadUtility.LoadIcon(activeSkill.Information.IconName); ConstructActivePanel(activeSkill); ConstructPassivePanel(activeSkill.AuxiliaryPassiveSkills); }
static SynastryCache() { var synastryReader = new SynastryReader(); var languageProjectSynastryAsset = ResourceLoadUtility.LoadData(LanguageProjectSynastryResource); var languageTechSynastryAsset = ResourceLoadUtility.LoadData(LanguageTechSynastryResource); var knowledgeTechSynastryAsset = ResourceLoadUtility.LoadData(KnowledgeTechSynastryResource); LanguageToProjectSynastry = synastryReader.ParseXml <SkillType, ProjectType>(languageProjectSynastryAsset.text); LanguageToTechSynastry = synastryReader.ParseXml <SkillType, RequiredTechType>(languageTechSynastryAsset.text); KnowledgeToTechSynastry = synastryReader.ParseXml <KnowledgeType, RequiredTechType>(knowledgeTechSynastryAsset.text); }
public void LoadStages() { currentAvailableStages = new List <GameStage>(); allStages = new List <GameStage>(); var projectContent = ResourceLoadUtility.LoadData("Stage").text; var rootElement = XElement.Parse(projectContent); foreach (var stageElement in rootElement.Elements("Stage")) { var newStage = new GameStage(); newStage.RecoverStateFromXml(stageElement.ToString()); allStages.Add(newStage); } }
private void PresentSelectedPanel() { for (int i = 0; i < selectedProgrammerCells.Length; ++i) { if (i < selectedSpecs.Count) { selectedProgrammerCells[i].SetActive(true); selectedProgrammerCells[i].GetComponentsInChildren <Image>().Last().sprite = ResourceLoadUtility.LoadPortrait(selectedSpecs.ElementAt(i).Status.PortraitName); selectedProgrammerCells[i].GetComponentsInChildren <Text>().Last().text = selectedSpecs.ElementAt(i).Status.Name; } else { selectedProgrammerCells[i].SetActive(false); } } }
private void PresentSelectedPanel(IEnumerable <Programmer> programmers) { foreach (var selectedProgrammerCell in selectedProgrammerCells) { selectedProgrammerCell.SetActive(false); } for (int i = 0; i < Mathf.Min(blankProgrammers, selectedProgrammerCells.Length); ++i) { selectedProgrammerCells[i].SetActive(true); selectedProgrammerCells[i].GetComponentsInChildren <Image>().Last().color = new Color(1, 1, 1, 0f); selectedProgrammerCells[i].GetComponentsInChildren <Text>().Last().text = string.Empty; if (i < selectedSpecs.Count) { selectedProgrammerCells[i].GetComponentsInChildren <Image>().Last().color = new Color(1, 1, 1, 1f); selectedProgrammerCells[i].GetComponentsInChildren <Image>().Last().sprite = ResourceLoadUtility.LoadPortrait(selectedSpecs.ElementAt(i).Status.PortraitName); selectedProgrammerCells[i].GetComponentsInChildren <Text>().Last().text = selectedSpecs.ElementAt(i).Status.Name; } } }
public void EnableBurfPopup() { if (Burfs == null) { return; } DestroyExistingItem(); foreach (var burf in Burfs) { var createdItem = Instantiate(burfItemTemplate, burfParentTransform); var imageComponent = createdItem.transform.GetComponentInChildren <Image>(); var textComponent = createdItem.transform.GetComponentsInChildren <Text>(); imageComponent.sprite = ResourceLoadUtility.LoadIcon(burf.IconName); textComponent[0].text = burf.RemainingTurn > 10000 ? "∞" : burf.RemainingTurn.ToString(); textComponent[1].text = burf.Description; } totalPanelObject.SetActive(true); }
private void RenderStatus(Programmer programmer) { programmerImage.sprite = ResourceLoadUtility.LoadPortrait(programmer.Status.PortraitName); statusPresenter.Present(programmer.Status); }