public override void Start() { collider = Parent.GetComponent <Collider>(); entity = new Entity(collider.shape, Mass) { Position = Physics.VectorT2B(Parent.Transform.Position), Orientation = Physics.QuaternionT2B(Parent.Transform.localRotation) }; Physics.AddEntity(entity, this); base.Start(); }
private void Connection_Completed(object sender, SocketAsyncEventArgs e) { if (e.SocketError == SocketError.Success) { Interlocked.CompareExchange(ref connected, 1, 0); Physics.AddEntity(this); StartReceive(); QueuePacket(new HandshakePacket(User.Username)); } else { throw new Exception("Could not connect to server!"); } }