displayHeroUID = null; $this->firendSupportHeroUID = null; $this->maxCollectCount = glc()->Game_CollectHero_BasicMaxCount; $this->recordMaxUID = 0; $this->collectHeros = ObjectInit(); # 设置初始英雄 $hids = GameConfig::primordial_data()->User_Heros; foreach ($hids as $heroModelId) { //1.检查是否存在这个英雄的模板 $heroCfg = GameConfig::hero_getItem($heroModelId); if ($heroCfg) { $uid = HeroProc::CreateNewGameHeroUID($this->collectHeros, $this->recordMaxUID); $this->recordMaxUID = $uid; $hero = HeroProc::getGameHeroModelInstance($heroCfg, $heroModelId, $uid); $this->collectHeros->$uid = $hero; $this->displayHeroUID = $uid; $this->firendSupportHeroUID = $uid; } } } }