void InitUI() { HeroData heroData = HeroManager.heroDataDic[heroTrainingData.heroID]; textTrainingStatName.text = heroData.trainingDataList[heroTrainingData.trainingStat].paramName; textCurrentTrainingValue.text = (heroData.trainingDataList[heroTrainingData.trainingStat].training + 1) + "단계"; //textMaxTrainingValue.text = heroData.trainingMax.ToString(); remainTimeText.text = remainTime.ToStringTimeHMS(); if (heroTrainingData.isTrainingMax == true) { buttonTrainingComplete.interactable = true; buttonInstantComplete.interactable = false; } else { buttonTrainingComplete.interactable = false; buttonInstantComplete.interactable = true; isChangable = true; } textHeroName.text = heroData.heroName; AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.baseData.image); }
public void InitSlot(HeroBaseData heroData = null, int monstarCount = 0) { heroSlotPanel.SetActive(heroData != null); if (heroData != null) { AssetLoader.AssignImage(imageHero, "sprite/hero", "Atlas_HeroImage", heroData.image); monsterCountPanel.SetActive(false); if (monstarCount > 0) { monsterCountPanel.SetActive(true); textMonsterCount.text = "X " + monstarCount.ToString(); } Sprite frame = null; for (int i = 0; i < gradeSpriteList.Count; i++) { frame = gradeSpriteList[i]; if (i == (heroData.grade - 1)) { break; } } if (frame != null) { gradeFrame.sprite = frame; } } }
void UpdateAutoQuestInfo() { BattleQuest quest = battleQuestController.currentBattleQuestAuto; if (quest == null) { buttonAutoQuestGold.interactable = false; buttonAutoQuestRuby.interactable = false; return; } //이미지 AssetLoader.AssignImage(imageAutoQuestIcon, "sprite/quest", "Atlas_Quest_Icon", quest.baseData.image); //퀘스트 이름, 해금 비용(골드, 루비) 표시 textAutoQuestName.text = quest.baseData.name; double autoQuestCost = quest.autoQuestCost; textAutoQuestCost.text = autoQuestCost.ToStringABC(); textAutoQuestCostRuby.text = quest.autoQuestCostRuby.ToString(); buttonAutoQuestGold.interactable = quest.level > 0; buttonAutoQuestRuby.interactable = quest.level > 0; quest.onUnlocked += OnUnlockedCureentAutoQuest; }
public void SlotInit(ArtifactBaseData data) { particleObject.SetActive(false); artifactBaseData = data; artifactName.text = data.name; artifactName.gameObject.SetActive(true); AssetLoader.AssignImage(artifactImage, "sprite/artifact", "Atlas_Artifact", artifactBaseData.icon, null); ArtifactController artifactController = Battle.currentBattleGroup.artifactController; Artifact artifact = artifactController.artifactList.Find(x => x.baseData.id == data.id); //현재 스택 상태에 따라 패러미터 변화량 보여줌 int currentStack = 0; if (artifact != null) { currentStack = artifact.stack; } float power = 0; float.TryParse(data.formula, out power); string powerBefore = (power * currentStack).ToString(); string powerAfter = (power * (currentStack + 1)).ToString(); string description = data.message.Replace("[formula]", "<color=#00ff00ff>" + powerAfter + "</color>"); if (artifact != null) { description = data.message.Replace("[formula]", "<color=#00ff00ff>" + powerBefore + " → " + powerAfter + "</color>"); } artifactMessage.text = description; artifactMessage.gameObject.SetActive(true); artifactImage.material.SetFloat("_Threshold", 0f); //버튼 활성화 button.interactable = true; //캔버스 랜더러들 알파 다 켜기 for (int i = 0; i < canvasRenderers.Length; i++) { canvasRenderers[i].SetAlpha(1f); } //유물 선택되었을 때 콜백 등록 UIArtifactSelect.onSelected += OnSelected; //게임 오브젝트 활성화 gameObject.SetActive(true); }
void InitMaterialImage(Image img, string spriteName) { img.gameObject.SetActive(false); if (string.IsNullOrEmpty(spriteName)) { return; } img.gameObject.SetActive(true); AssetLoader.AssignImage(img, "sprite/material", "Atlas_Material", spriteName); }
void InitGoodsImage(string spritName) { GoodContentsImage.gameObject.SetActive(false); if (string.IsNullOrEmpty(spritName)) { return; } GoodContentsImage.gameObject.SetActive(true); AssetLoader.AssignImage(GoodContentsImage, "sprite/product", "Atlas_Product", spritName); }
public void InitImage(Sprite sprite = null) { if (sprite == null) { AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); } else { heroImage.sprite = sprite; } }
public void Show(string placeID, placeInfoType infoType) { panelPlaceInfo.SetActive(true); place = WorldMapController.Instance.placeDic[placeID]; place.placeData.onChangedPlaceLevel += OnChagedPlaceLevel; place.placeData.onChangedHeroList += OnChangedDeployHeroData; productSlot.InitSlot(place.placeData); OnChangedDeployHeroData(); textPlaceName.text = GameDataManager.placeBaseDataDic[placeID].name; string description = GameDataManager.placeBaseDataDic[placeID].placeBuffDescription.Replace("[formula]", "<color=#00ff00ff>" + place.placeData.power.ToString() + "</color>"); textDiscripcion.text = description; KingdomManagement.Item baseData = GameDataManager.itemDic[GameDataManager.placeBaseDataDic[placeID].productID]; textProductName.text = baseData.name; AssetLoader.AssignImage(imageProduct, "sprite/material", "Atlas_Material", baseData.image); textPlaceLevel.text = place.placeLevel.ToString(); textAddCost.text = place.addCost.ToStringABC(); textUpgradeCost.text = place.upgradeCost.ToStringABC(); addPlaceInfopPanel.SetActive(infoType == placeInfoType.AddPlace); emptyPlaceInfoPanel.SetActive(infoType == placeInfoType.EmptyPlace); for (int i = 0; i < resourcePoolList.Count; i++) { resourcePoolList[i].gameObject.SetActive(false); } if (MoneyManager.GetMoney(MoneyType.placeTicket).value == 0) { buttonUpgrade.interactable = false; buttonPlaceAdd.interactable = false; return; } if (place != null) { //buttonUpgrade.interactable = MoneyManager.GetMoney(MoneyType.gold).value >= place.upgradeCost; //buttonPlaceAdd.interactable = MoneyManager.GetMoney(MoneyType.gold).value >= place.addCost; //to do : 테스트를 위해 placeTicket만 사용하여 영지 점령과 강화를 한다. buttonUpgrade.interactable = true; buttonPlaceAdd.interactable = true; } }
void SlotUIInit() { if (itemType == "buff") { string spriteName = "ShopIconGameSpeedx2"; AssetLoader.AssignImage(itemIconImage, "sprite/product", "Atlas_Product", spriteName); } else if (itemType == "draw") { if (GameDataManager.heroBaseDataDic.ContainsKey(itemID)) { string spriteName = GameDataManager.heroBaseDataDic[itemID].image; AssetLoader.AssignImage(itemIconImage, "sprite/hero", "Atlas_HeroImage", spriteName); } } else if (itemType == "money") { if (GameDataManager.moneyBaseDataDic.ContainsKey(itemID)) { string spriteName = GameDataManager.moneyBaseDataDic[itemID].spriteName; AssetLoader.AssignImage(itemIconImage, "sprite/product", "Atlas_Product", spriteName); } } senderText.text = sender; LocalizeDynamicText dynamicTextTitle = titleText.gameObject.AddComponent <LocalizeDynamicText>(); dynamicTextTitle = new LocalizeDynamicText(titleText); dynamicTextTitle.InitLocalizeText(title); LocalizeDynamicText dynamicTextMsg = messageText.gameObject.AddComponent <LocalizeDynamicText>(); dynamicTextMsg = new LocalizeDynamicText(messageText); dynamicTextMsg.InitLocalizeText(message); //titleText.text = title; //messageText.text = message; if (itemType == "buff") { itemAmountText.text = Mathf.Floor(int.Parse(itemAmount) / 86400) + "Days"; } else { itemAmountText.text = string.Format("{0:#,###}", Convert.ToInt32(itemAmount));// itemAmount; } ShowRemainTime(); }
/// <summary> 슬롯 초기화 </summary> public void initDeployHeroSlot(string id) { heroData = HeroManager.heroDataDic[id]; if (heroData != null) { ShowGrade(heroData.heroGrade); } heroNameText.text = heroData.heroName; AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); textEnhance.gameObject.SetActive(heroData.enhance > 0); textEnhance.text = "+" + heroData.enhance; textRebirth.gameObject.SetActive(heroData.rebirth > 0); textRebirth.text = heroData.rebirth.ToString(); }
public void InitImage() { AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); Material grayScaleMeterial = new Material(heroImage.material); if (dictionaryLevel == 0) { grayScaleMeterial.SetFloat("_GrayScale", 0f); heroImage.material = grayScaleMeterial; } else { grayScaleMeterial.SetFloat("_GrayScale", 1f); heroImage.material = grayScaleMeterial; //heroImage.color = new Color(255, 255, 255); } }
void InitGoodsImage(string spritName) { GoodContentsImage.gameObject.SetActive(false); if (string.IsNullOrEmpty(spritName)) { return; } GoodContentsImage.gameObject.SetActive(true); AssetLoader.AssignImage(GoodContentsImage, "sprite/product", "Atlas_Product", spritName); //for (int i = 0; i < productSpriteList.Count; i++) //{ // if(productSpriteList[i].name == spritName) // { // GoodContentsImage.gameObject.SetActive(true); // GoodContentsImage.sprite = productSpriteList[i]; // break; // } //} }
public void SlotInit(Artifact artifact) { this.artifact = artifact; title = artifact.baseData.name; message = artifact.baseData.message; stackCount.text = artifact.stack.ToString(); textName.text = artifact.baseData.name; AssetLoader.AssignImage(relicsImage, "sprite/artifact", "Atlas_Artifact", artifact.baseData.icon, null); ArtifactController artifactController = Battle.currentBattleGroup.artifactController; //설명에 있는 능력치는 현재 스택되어 적용되고 있는 능력치로 보여줌 float power = 0; float.TryParse(artifact.baseData.formula, out power); string description = artifact.baseData.message.Replace("[formula]", "<color=#00ff00ff>" + (power * artifact.stack).ToString() + "</color>"); textDescription.text = description; }
public void InitSlot(HeroData heroData = null) { heroSlotPanel.SetActive(heroData != null); if (heroData != null) { AssetLoader.AssignImage(imageHero, "sprite/hero", "Atlas_HeroImage", heroData.baseData.image); enhancePanel.SetActive(false); rebirthPanel.SetActive(false); if (heroData.enhance > 0) { enhancePanel.SetActive(true); textEnhance.text = heroData.enhance.ToString(); } if (heroData.rebirth > 0) { rebirthPanel.SetActive(true); textRebirth.text = heroData.rebirth.ToString(); } } }
/// <summary> 슬롯 초기화 </summary> public void initHeroGuildSlot(VisitedHeroData _visitedHeroData) { heroID = _visitedHeroData.heroID; visitedHeroData = _visitedHeroData; heroData = new HeroData(HeroManager.heroBaseDataDic[heroID]); if (heroData != null) { ShowGrade(heroData.heroGrade); } heroNameText.text = heroData.heroName; AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); // 가격 공식 변경되면 서버에서 변경해야함... cost = 10000 * (Mathf.Pow(10, heroData.heroGrade)); textCostText.text = cost.ToStringABC(); textRemainingTime.text = RemainTime(); }
IEnumerator Start() { while (GameDataManager.Instance == false) { yield return(null); } while (!WorldMapController.Instance.isInitialized) { yield return(null); } if (placeBaseData != null) { string buildingImageName = GameDataManager.itemDic[placeBaseData.productID].image; AssetLoader.AssignImage(imageProductIcon, "sprite/material", "Atlas_Material", buildingImageName); } uiPlace.InitUIPlace(placeID); nameText.text = GameDataManager.placeBaseDataDic[placeID].name; }
public void InitSlot(int rank, BattleHero _battleHero) { battleHero = _battleHero; HeroData heroData = battleHero.heroData; battleHero.onChangedCumulativeDamage += OnChangedCumulativeDamage; AssetLoader.AssignImage(imageHero, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); textHeroName.text = heroData.heroName; Sprite sprite = null; for (int i = 0; i < heroGradeFrameList.Count; i++) { if (i == (heroData.heroGrade - 1)) { ColorUtility.TryParseHtmlString(colorHashList[i], out gradeColor); sprite = heroGradeFrameList[i]; break; } } if (sprite != null) { imageGradeFrame.sprite = sprite; imageGradePanel.color = gradeColor; } string enhance = heroData.enhance == 0 ? "" : heroData.enhance.ToString(); string rebirth = heroData.rebirth == 0 ? "" : heroData.rebirth.ToString(); textEnhance.text = enhance; textRebirth.text = rebirth; textRank.text = rank + "위"; textDamge.text = "0"; fillAmount.fillAmount = 0; }
public void InitSlot(HeroData heroData = null) { heroSlotPanel.SetActive(heroData != null); if (heroData != null) { AssetLoader.AssignImage(imageHero, "sprite/hero", "Atlas_HeroImage", heroData.baseData.image); enhancePanel.SetActive(false); rebirthPanel.SetActive(false); if (heroData.enhance > 0) { enhancePanel.SetActive(true); textEnhance.text = heroData.enhance.ToString(); } if (heroData.rebirth > 0) { rebirthPanel.SetActive(true); textRebirth.text = heroData.rebirth.ToString(); } Sprite frame = null; for (int i = 0; i < gradeSpriteList.Count; i++) { frame = gradeSpriteList[i]; if (i == (heroData.heroGrade - 1)) { break; } } if (frame != null) { gradeFrame.sprite = frame; } } }
public void Show() { //test.gameObject.SetActive(false); if (HeroTrainingManager.Instance == null) { return; } if (string.IsNullOrEmpty(selectedTrainingHeroID)) { noTrainingHeroPanel.SetActive(true); heroSelectButton.SetActive(false); } else { for (int i = 0; i < statSlotList.Count; i++) { statSlotList[i].InitSlot(); } noTrainingHeroPanel.SetActive(false); heroSelectButton.SetActive(true); HeroData heroData = HeroManager.heroDataDic[selectedTrainingHeroID]; for (int i = 0; i < gradeList.Count; i++) { if (heroData.heroGrade == (i + 1)) { gradeList[i].SetActive(true); heroBG.color = colorList[i]; } else { gradeList[i].SetActive(false); } } heroName.text = heroData.heroName; AssetLoader.AssignImage(heroImage, "sprite/hero", "Atlas_HeroImage", heroData.heroImageName); for (int i = 0; i < textParamNameList.Count; i++) { textParamNameList[i].gameObject.SetActive(false); } for (int i = 0; i < heroData.trainingDataList.Count; i++) { textParamNameList[i].gameObject.SetActive(true); textParamNameList[i].text = heroData.trainingDataList[i].paramName; textCurrentTrainingValueList[i].text = heroData.trainingDataList[i].training + "단계"; //textMaxTrainingValueList[i].text = heroData.trainingMax.ToString(); } int count = 0; for (int i = 0; i < heroData.trainingDataList.Count; i++) { count += heroData.trainingDataList[i].training; } textTrainingPoint.text = (heroData.trainingMax - count).ToString(); CheckNeedMoneyAndTime(selectedTrainingHeroID); ShowMaxPanel(); } SizeControl(); }
public void ChangeProductImage(UnityEngine.UI.Image image, string spriteName) { AssetLoader.AssignImage(image, "sprite/product", "Atlas_Product", spriteName); }
/// <summary> Atlas_Material 에서 재료 이미지를 찾아준다. </summary> public void ChangeMaterialImage(UnityEngine.UI.Image image, string spriteName) { AssetLoader.AssignImage(image, "sprite/material", "Atlas_Material", spriteName); }
IEnumerator ShowCoroutine() { string key = currentTapDay.ToString() + "_" + dungeonLevel; //Debug.Log(key); if (GameDataManager.dayDungeonBaseDataDic.ContainsKey(key)) { DayDungeonBaseData data = GameDataManager.dayDungeonBaseDataDic[key]; textDungeonName.text = data.name; if (string.IsNullOrEmpty(data.bossData.id) == false) { if (bossObj != null) { bossObj.SetActive(false); bossObj.transform.SetParent(CharacterEmptyPool.Instance.transform); } GameObject go = null; yield return(StartCoroutine(CharacterEmptyPool.Instance.GetHero(data.bossData.id, x => go = x))); bossObj = go; bossObj.transform.position = pivot.position; bossObj.transform.SetParent(pivot); bossObj.transform.localScale = Vector3.one; //bossObj.SetActive(true); } for (int i = 0; i < monsterSlotList.Count; i++) { monsterSlotList[i].InitSlot(); } for (int i = 0; i < data.monsterList.Count; i++) { string monsterID = data.monsterList[i].id; int amount = data.monsterList[i].amount; if (GameDataManager.heroBaseDataDic.ContainsKey(monsterID)) { HeroBaseData heroBaseData = GameDataManager.heroBaseDataDic[monsterID]; monsterSlotList[i].InitSlot(heroBaseData, amount); } } battleStartButton.interactable = currentTapDay == BattleDayDungeonManager.today && dungeonLevel <= topLevel; if (GameDataManager.moneyBaseDataDic.ContainsKey(data.rewardID)) { MoneyBaseData moneyBase = GameDataManager.moneyBaseDataDic[data.rewardID]; AssetLoader.AssignImage(imageReward, "sptire/material", "Atlas_Material", moneyBase.spriteName); textRewardName.text = moneyBase.name; textRewardAmount.text = data.rewardAmont.ToStringABC(); } } if (bossObj != null) { bossObj.SetActive(true); } dayDungeonCanvas.enabled = true; lightPanel.SetActive(true); dayDungeonPanel.SetActive(true); showCoroutine = null; }
void InitImage() { AssetLoader.AssignImage(imageHero, "sprite/hero", "Atlas_HeroImage", battleHero.heroData.heroImageName, OnFinisthInitImage); }