示例#1
0
    private void On_NETWORK_StartedHost(BEHandle handle)
    {
        LogNotification("Started new Host.");

        // Stop looking for hosts on the netwrok
        //StopCoroutine(connctionTimeoutEnumerator);
    }
示例#2
0
    private void On_NETWORK_ConnectedToHost(BEHandle <ENetworkID> handle)
    {
        LogNotification("Connected to host as : " + handle.Arg1);

        // Stop looking for hosts on the netwrok
        //StopCoroutine(connctionTimeoutEnumerator);
    }
示例#3
0
 private void On_NETWORK_NetworkStateUpdated(BEHandle <ENetworkState> handle)
 {
     if (networkIDText)
     {
         networkIDText.SetText("NetworkID : " + BEventManager.Instance.LocalNetworkID);
     }
 }
示例#4
0
    private void On_TEST_CounterIncrement(BEHandle <int> handle)
    {
        counter = handle.Arg1 + 1;

        if (IS_NOT_NULL(counterBText))
        {
            counterBText.SetText("Counter : " + counter);
        }
    }
示例#5
0
 private void On_AR_TrackerFound(BEHandle <string, Vector3, Quaternion> handle)
 {
     //if (IS_NOT_NULL(newTracker))
     //{
     //    if (newTracker.TrackerName == "TrackerImage_Test")
     //    {
     //        tracker = newTracker;
     //        image.SetColor(Color.green);
     //    }
     //}
 }
示例#6
0
 private void On_NETWORK_NetworkStateUpdated(BEHandle <ENetworkState> handle)
 {
     if (handle.Arg1 != ENetworkState.NOT_CONNECTED)
     {
         ReinitializeDiscovery();
         InvokeEventIfBound(DiscoveredServersUpdated, DiscoveredServers.Keys.ToArray());
     }
     else
     {
         FindServers();
     }
 }
示例#7
0
    private void On_AR_NewPlayAreaSet(BEHandle <BAnchorInformation[]> handle)
    {
        if (handle.InvokingNetworkID != BEventManager.Instance.LocalNetworkID)
        {
            AbstractPlayArea playArea = SpawnNewPlayArea();
            playArea.Owner = handle.InvokingNetworkID;

            if (IS_NOT_NULL(playArea))
            {
                playArea.SetUpPlayArea(handle.Arg1);
            }
        }
    }
示例#8
0
    private void On_AR_BAnchorSpawned(BEHandle <BAnchorInformation, string> handle)
    {
        BAnchorInformation bAnchorInformation = handle.Arg1;
        string             bAnchorID          = handle.Arg2;
        BAnchor            bAnchorPrefab      = GetBAnchorPrefab(bAnchorID);

        if (handle.InvokingNetworkID != BEventManager.Instance.LocalNetworkID &&
            IS_NOT_NULL(bAnchorPrefab) &&
            IS_NOT_NULL(bAnchorInformation))
        {
            BAnchor spawnedBAnchor = Instantiate(bAnchorPrefab, Vector3.zero, Quaternion.identity);
            spawnedBAnchor.SetTransformedPosition(bAnchorInformation.TransformedPosition);
            spawnedBAnchor.SetTransformedRotation(bAnchorInformation.TransformedRotation);
            spawnedBAnchor.Owner = handle.InvokingNetworkID;

            BEventsCollection.AR_BAnchorSpawned.Invoke(new BEHandle <BAnchorInformation, string>(bAnchorInformation, bAnchorID), BEventReplicationType.LOCAL, true);
        }
    }
示例#9
0
    private void On_NETWORK_DiscoveredHostsUpdated(BEHandle <string[]> handle)
    {
        int hostsCount = handle.Arg1.Length;

        LogNotification("Discovered hosts list updated : " + hostsCount);

        if (hostsCount == 0)
        {
            serversCountText.SetText("No Hosts found.");
            connectToServerButton.DisableButton();
            //connectToServerButton.CanBeShown = false;
        }
        else
        {
            serversCountText.SetText("Hosts : " + hostsCount);
            //connectToServerButton.CanBeShown = true;
            connectToServerButton.EnableButton();
        }
    }
示例#10
0
    private void On_NETWORK_NewBEventDispatcherSet(BEHandle <AbstractBEventDispatcher> handle)
    {
        if (IS_NOT_NULL(dispatcherText))
        {
            dispatcherText.SetText(handle.Arg1.GetBEventDispatcherType().ToString());
        }

        if (IS_NOT_NULL(dispatcherButton))
        {
            switch (handle.Arg1.GetBEventDispatcherType())
            {
            case BEventDispatcherType.MIRROR:
                dispatcherButton.SetButtonText("Switch Ubii");
                break;

            default:
                dispatcherButton.SetButtonText("Switch Mirror");
                break;
            }
        }
    }
示例#11
0
    private void On_NETWORK_NetworkStateUpdated(BEHandle <ENetworkState> handle)
    {
        if (IS_NOT_NULL(bFrame) &&
            (IS_NOT_NULL(notConnectedMenu)) &&
            (IS_NOT_NULL(hostMenu)) &&
            (IS_NOT_NULL(clientMenu)))
        {
            switch (handle.Arg1)
            {
            case ENetworkState.NOT_CONNECTED:
                bFrame.UpdateCurrentBMenu(notConnectedMenu);
                break;

            case ENetworkState.HOST:
                bFrame.UpdateCurrentBMenu(hostMenu);
                break;

            case ENetworkState.CLIENT:
                bFrame.UpdateCurrentBMenu(clientMenu);
                break;
            }
        }
    }
示例#12
0
 private void On_TEST_ImagePosition(BEHandle <Vector3> bEHandle)
 {
     transform.position = bEHandle.Arg1;
 }
示例#13
0
 private void On_NETWORK_NewNetworkIDDisconnected(BEHandle <ENetworkID> handle)
 {
     LogNotification("Client disconnected : " + handle.Arg1);
 }
示例#14
0
 private void On_TEST_FloatTest(BEHandle <float> handle)
 {
     LogConsole("On_TEST_FloatTest : " + BUtils.GetTimeAsString());
 }
示例#15
0
 private void On_NETWORK_ConnectionStoped(BEHandle obj)
 {
     LogNotification("The connection was stopped");
 }
示例#16
0
 private void On_TEST_Vector3Test(BEHandle <Vector3> handle)
 {
     LogConsole("On_TEST_Vector3Test : " + BUtils.GetTimeAsString());
 }
示例#17
0
 private void On_TEST_TrackerMoved(BEHandle <Vector3> handle)
 {
     transform.position = handle.Arg1;
 }
示例#18
0
 private void On_TEST_ObjectTest(BEHandle <BallDroneBAnchor> handle)
 {
     LogConsole("On_TEST_ObjectTest : " + BUtils.GetTimeAsString());
 }