public void RefreshUI() { calculations = UpgradeUtils.CalculateUpgrade(upgradeName, upgrade.currentLevel, baseCost, heroUnlockOrder, FindObjectOfType <GameManager>().buyAmountDic[panelName]); UIDic[uiNames[1]].text = "(LVL: " + RoundingUtils.GetShorthand(upgrade.currentLevel) + ")"; UIDic[uiNames[2]].text = "Damage: " + RoundingUtils.GetShorthand(upgrade.currentDamage) + " DPS"; UIDic[uiNames[3]].text = RoundingUtils.GetShorthand(Mathf.Round(calculations[0])); UIDic[uiNames[4]].text = "+ " + RoundingUtils.GetShorthand(Mathf.Round(calculations[1])) + " DPS"; UIDic[uiNames[5]].text = "BUY: " + RoundingUtils.GetShorthand(Mathf.Round(calculations[2])); }
public IGH_DocumentObject Upgrade(IGH_DocumentObject target, GH_Document document) { if (!(target is IGH_Component component)) { return(null); } var upgradedComponent = GH_UpgradeUtil.SwapComponents(component, UpgradeTo); upgradedComponent.Params.Input[0].Access = GH_ParamAccess.item; upgradedComponent.Params.Output[0].Access = GH_ParamAccess.item; UpgradeUtils.SwapGroups(document, component, upgradedComponent); return(upgradedComponent); }
public IGH_DocumentObject Upgrade(IGH_DocumentObject target, GH_Document document) { IGH_Component component = target as IGH_Component; if (component == null) { return(null); } IGH_Component upgradedComponent = GH_UpgradeUtil.SwapComponents(component, UpgradeTo); UpgradeUtils.SwapGroups(document, component, upgradedComponent); return(upgradedComponent); }
public IGH_DocumentObject Upgrade(IGH_DocumentObject target, GH_Document document) { IGH_Component component = target as IGH_Component; if (component == null) { return(null); } IGH_Component upgradedComponent = GH_UpgradeUtil.SwapComponents(component, UpgradeTo); upgradedComponent.Params.Input[0].Access = GH_ParamAccess.item; upgradedComponent.Params.Input[2].Access = GH_ParamAccess.tree; UpgradeUtils.SwapGroups(document, component, upgradedComponent); return(upgradedComponent); }
private void SyncUI() { UIDic[uiNames[4]].GetComponentInChildren <TextMeshProUGUI>().text = RoundingUtils.GetShorthand(Mathf.Round(GameData.sessionData.playerData.gold)); UIDic[uiNames[5]].GetComponentInChildren <TextMeshProUGUI>().text = GameData.sessionData.playerData.stage.ToString(); UIDic[uiNames[6]].GetComponentInChildren <TextMeshProUGUI>().text = GameData.sessionData.playerData.monsterNum.ToString() + "/10"; UIDic[uiNames[7]].GetComponentInChildren <TextMeshProUGUI>().text = RoundingUtils.GetShorthand(GameData.sessionData.playerUpgrade.currentDamage); UIDic[uiNames[8]].GetComponentInChildren <TextMeshProUGUI>().text = RoundingUtils.GetShorthand(UpgradeUtils.GetTotalHeroDPS()); UpgradeUtils.UnlockNextHero(UIDic[uiNames[10]].gameObject); if (GameData.sessionData.heroUpgrades[0].unlocked == true && changeSprite == false) { Transform btn = UIDic[uiNames[3]].Find(uiNames[10]); btn.GetComponentInChildren <Button>().onClick.AddListener(() => TogglePanel(UIDic[uiNames[10]].gameObject)); btn.GetComponentInChildren <Image>().color = new Color32(50, 92, 233, 255); // Brighten the button btn.Find("Icon").GetComponent <Image>().sprite = Resources.Load <Sprite>("Art/HeroUpgrades") as Sprite; // Set button sprite btn.Find("Icon").GetComponent <Image>().color = new Color32(255, 255, 255, 200); // Change Icon Brightness changeSprite = true; } }
// use this as a relay because we cannot invoke repeating if the method needs params private void HeroDamageRelay() { takeDamage(UpgradeUtils.GetTotalHeroDPS()); }
void Awake() { DontDestroyOnLoad(this); UpgradeUtils upUtils = new UpgradeUtils(); RoundingUtils roUtils = new RoundingUtils(); }