//玩家初始化,生成城镇和英雄 void InitPlayer(Player _player) { Town town = CreateObjectOnNode(prefab_town, _player.startingPoint).GetComponent <Town>(); _player.towns.Add(town); Vector2Int offset = town.interactPoint; Hero hero = CreateObjectOnNode(prefab_hero, _player.startingPoint + offset).GetComponent <Hero>(); //英雄类型 hero.heroType = HeroType.GetHeroType("Jaina"); hero.Init(); _player.heroes.Add(hero); //添加英雄初始兵力 hero.pocketUnits[0] = new PocketUnit(UnitType.GetUnit("Crusader_Upgrade"), 40); hero.pocketUnits[1] = new PocketUnit(UnitType.GetUnit("Tyrael"), 10); //非AI if (!_player.isAI) { //移动镜头到英雄 //HighlightHero(hero); } }