Exemplo n.º 1
0
    void OnShoot(PlayerShoot shoot)
    {
        Player p = lm.GetPlayer(shoot.id);

        if (p != null)
        {
            if (p.playerType == PlayerType.Remote)
            {
                RemotePlayerController rpc = p.GetComponent <RemotePlayerController>();
                Vector3 targePoint         = new Vector3(shoot.targetPointX, shoot.targetPointY, shoot.targetPointZ);
                rpc.Shoot(targePoint);
            }
        }
    }
Exemplo n.º 2
0
    void OnShoot(PlayerShoot shoot, Connection conn)
    {
        if (conn.state == ConnState.InGame)
        {
            Player p = lm.GetPlayer(shoot.id);
            if (p != null)
            {
                if (p.playerType == PlayerType.Remote)
                {
                    RemotePlayerController rpc = p.GetComponent <RemotePlayerController>();
                    Vector3 targePoint         = new Vector3(shoot.targetPointX, shoot.targetPointY, shoot.targetPointZ);
                    rpc.Shoot(targePoint);

                    SendShoot(shoot);
                }
            }
        }
    }