public void spawnHeroAtLocation()
    {
        Vector3   hardpointLocation = heroSelector.getLastHardpointSelected().position;
        Transform createdUnit       = Instantiate(heroPrefab, new Vector3(hardpointLocation.x,
                                                                          hardpointLocation.y + 1, hardpointLocation.z), heroPrefab.rotation);

        createdUnit.GetComponent <FreeHardpoint>().setHardpoint(heroSelector.getLastHardpointSelected().GetComponent <Hardpoint>());
        heroSelector.closeHeroSelector();
        requisitionManager.deductPoints(heroStats.getCost());
        heroSelector.getLastHardpointSelected().GetComponent <Hardpoint>().placeUnit();
    }
示例#2
0
 public void updateUI()
 {
     currentHp.text          = "" + selectedHeroHealthBar.getCurrentHealth() + " / " + selectedHeroHealthBar.getMaxHealth();
     currentAttackSpeed.text = "" + Utils.calculateAttackRate(selectedHeroStats.getUnitType(), selectedHeroStats.getAgility());
     unitType.text           = "" + Enum.GetName(typeof(Utils.UnitType), selectedHeroStats.getUnitType());
     currentExperience.text  = "" + selectedHeroStats.getExperience();
     Level.text            = "" + selectedHeroStats.getLevel();
     nextLevelXP.text      = "" + selectedHeroStats.getNextLevelExperience();
     Health.text           = "" + selectedHeroStats.getHealth();
     Attack.text           = "" + selectedHeroStats.getAttack();
     Magic.text            = "" + selectedHeroStats.getMagic();
     Defense.text          = "" + selectedHeroStats.getDefense();
     Resistance.text       = "" + selectedHeroStats.getResistance();
     Agility.text          = "" + selectedHeroStats.getAgility();
     Block.text            = "" + selectedHeroStats.getBlock();
     refundButtonText.text = "REFUND\n +" + (int)(selectedHeroStats.getCost() * .66f) + " REQ";
     updateAbilityButtonValidity();
 }
 public void setHeroStats(HeroStats heroStats)
 {
     this.heroStats   = heroStats;
     costTextBox.text = "" + heroStats.getCost();
 }