public override void OnLobbyServerSceneLoadedForPlayer(NetworkManager manager, GameObject lobbyPlayer, GameObject gamePlayer) { LHLobbyPlayer lobby = lobbyPlayer.GetComponent <LHLobbyPlayer>(); LHNetworkPlayer player = gamePlayer.GetComponent <LHNetworkPlayer>(); player.name = lobby.name; player.playerName = lobby.playerName; player.team = lobby.playerTeam; //player.charactor = lobby.playerCharactor; }
private void OnTriggerEnter2D(Collider2D collision) { if (coldTime >= 1 && collision.gameObject.tag == "Player") { LHNetworkPlayer player = collision.GetComponent <LHNetworkPlayer>(); EnegySprite _eSprit = player.GetEnegySprite(); if (_eSprit) { _eSprit.OnSelfDestory(); manager.OnUseEnegy(player); coldTime = 0; } } }
public void OnUseEnegy(LHNetworkPlayer player) { int teamIndex = player.team; switch (teamIndex) { case 1: team_1_Num += player.GetEnegySprite().EnenyNum; ui_main.OnAddEnegy(teamIndex, team_1_Num); break; case 2: team_2_Num += player.GetEnegySprite().EnenyNum; ui_main.OnAddEnegy(teamIndex, team_2_Num); break; } RemoveSprite(player.GetEnegySprite()); }
private void OnTriggerEnter2D(Collider2D collision) { LHNetworkPlayer _player = collision.gameObject.GetComponent <LHNetworkPlayer>(); if (_player && (_player.team != _borner.team || TeamEffect)) { if (IsCarryer) { GameObject bullet = Instantiate(BornBullet.gameObject, transform.position, Quaternion.identity); NetworkServer.Spawn(bullet); } else { //TODO:自身对敌人产生左右 } if (!CrossOver) { Destroy(this.gameObject); } } }
public void Init(LHNetworkPlayer player) { localPlayer = player; ui_select.Init(charListObj, localPlayer); hasLocalPlayer = true; }
/// <summary> /// 传入角色arr和玩家对象 /// </summary> /// <param name="arr"></param> /// <param name="_player"></param> public void Init(CharacterConfig obj, LHNetworkPlayer _player) { charListObj = obj; LocalPlayer = _player; OnSetArrData(); }