コード例 #1
0
    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;
    }
コード例 #2
0
 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;
         }
     }
 }
コード例 #3
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());
    }
コード例 #4
0
    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);
            }
        }
    }
コード例 #5
0
 public void Init(LHNetworkPlayer player)
 {
     localPlayer = player;
     ui_select.Init(charListObj, localPlayer);
     hasLocalPlayer = true;
 }
コード例 #6
0
ファイル: UISelectChar.cs プロジェクト: BenDJoaner/0Hen-Force
 /// <summary>
 /// 传入角色arr和玩家对象
 /// </summary>
 /// <param name="arr"></param>
 /// <param name="_player"></param>
 public void Init(CharacterConfig obj, LHNetworkPlayer _player)
 {
     charListObj = obj;
     LocalPlayer = _player;
     OnSetArrData();
 }