GameClient.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
	void Update ()
    {
	    _netClient.PollEvents();

        if (_netClient.IsConnected)
        {
            //Fixed delta set to 0.05
            var pos = _clientBallInterpolated.transform.position;
            pos.x = Mathf.Lerp(_oldBallPosX, _newBallPosX, _lerpTime);
            _clientBallInterpolated.transform.position = pos;

            //Basic lerp
            _lerpTime += Time.deltaTime/Time.fixedDeltaTime;
        }
        else
        {
            _netClient.SendDiscoveryRequest(new byte[] { 1 }, 5000);
        }
    }

Usage Example

Esempio n. 1
0
 private void timer_update_Tick(object sender, EventArgs e)
 {
     if (m_client != null)
     {
         m_client.Update();
     }
 }
All Usage Examples Of GameClient::Update