public void UpdateInfo() { GameEntityMgr instance = GameEntityMgr.Instance; if (instance == null) { return; } List <GameEntity> players = instance.GetAllPlayers(); }
internal static void SpawnPlayer(EntityZhiye zhiye) { GameEntityMgr entityMgr = GetRegistServices <GameEntityMgr>(); int cnt = entityMgr.GetAllPlayers().Count; if (cnt >= ProjectConsts.MAXPLAYER_CONTROLL_ENTITY_CNT) { return; } string prefabname = "GameEntity"; GameObject prefab = Resources.Load <GameObject>(prefabname); GameObject clone = GameObject.Instantiate(prefab); GameEntity entity = clone.GetComponent <GameEntity>(); entity.SetEntityZhiyeConfig(zhiye); entity.SetControllType(EntityType.Player); entityMgr.RegEntity(clone.GetComponent <GameEntity>()); }