LiteNetLib.Utils.NetDataReader.GetFloat C# (CSharp) Method

GetFloat() public method

public GetFloat ( ) : float
return float
        public float GetFloat()
        {
            float result = BitConverter.ToSingle(_data, _position);
            _position += 4;
            return result;
        }

Usage Example

Example #1
0
    public void OnNetworkReceive(NetPeer peer, NetDataReader reader)
    {
        _newBallPosX = reader.GetFloat();

        var pos = _clientBall.transform.position;

        _oldBallPosX = pos.x;
        pos.x = _newBallPosX;

        _clientBall.transform.position = pos;

        _lerpTime = 0f;
    }
All Usage Examples Of LiteNetLib.Utils.NetDataReader::GetFloat