Exemplo n.º 1
0
 void Awake()
 {
     animator       = GetComponent <Animator> ();
     spriteRenderer = GetComponent <SpriteRenderer> ();
     rig2d          = GetComponent <Rigidbody2D> ();
     SyncGameObject = GetComponent <SyncGameObject>();
 }
Exemplo n.º 2
0
    private async void Start()
    {
        SyncGameObject = GetComponent <SyncGameObject>();
        await UniTask.Delay(500);

        connectedpeertext.text = "Connected Peer:" + UniP2PManager.GetPeerConnectedCount();
        LogUpdate();
        await RpcTest();

        LogUpdate();
        await SendData();

        LogUpdate();
        await SendByteArray();

        LogUpdate();
        await UniTask.Delay(500);

        foreach (var peer in UniP2PManager.GetAllPeer())
        {
            if (peer.State == PeerState.Connected)
            {
                var ms = await UniP2PManager.Ping(peer);

                pingtext.text = peer.ID + ":" + ms + "ms" + "\n";
            }
        }
    }
Exemplo n.º 3
0
 private void Awake()
 {
     SyncGameObject = GetComponent <SyncGameObject>();
     m_Rigidbody    = GetComponent <Rigidbody>();
 }
Exemplo n.º 4
0
 private void Awake()
 {
     // Set up the references.
     m_Rigidbody    = GetComponent <Rigidbody>();
     SyncGameObject = GetComponent <SyncGameObject>();
 }