void SetToChosenHero() { Hero hero = UnitCreator.FindUnitPrefabByName(Global.instance.armySavingManager.currentSave.heroPrefabPath).GetComponent <Hero>(); OnHeroChoice(hero.avatarTransparent); UnitStatShower.UpdateUnitInfo(hero); pedestal.ShowUnit(hero.gameObject); }
void InstantiateUnit(string unitID, int playerID, int index) { GameObject UnitObject = UnitCreator.FindUnitPrefabByName(unitID); GameObject InstantiatedUnit = Instantiate(UnitObject, Vector3.zero, UnitObject.transform.rotation); Unit myUnit = InstantiatedUnit.GetComponent <Unit>(); myUnit.index = index; Global.instance.playerTeams[playerID].players[0].AddUnit(myUnit); InstantiatedUnit.name = myUnit.info.unitName; }