示例#1
0
    public void SendTransform(Vector3 pos, Quaternion rot)
    {
        if (connector.isConnected && connector.isInActiveRoom)
        {
            if (Time.time - timeupdated > .1f)
            {
                timeupdated = Time.time;

                writer.Reset();
                writer.Put(pos);// + new Vector3(Random.Range(-5,5),0, Random.Range(-5, 5)));
                writer.Put(rot);
                //writer.Put(System.DateTime.Now.ToFileTimeUtc());
                //Debug.Log(writer.Length);
                connector.RaiseEventOnAll(1, writer, DeliveryMethod.Unreliable);
            }
        }
    }
示例#2
0
 public void SendData()
 {
     writer.Reset();
     writer.Put("Message from " + id + " at " + Time.fixedTime);
     connector.RaiseEventOnAll(0, writer, DeliveryMethod.ReliableOrdered);
 }