Exemple #1
0
        void Start()
        {
            players = new List <Player> ();
            Debug.Log("Initializing Coda system");
            if (CodaRTNetClient.InitSystem())
            {
                if (CodaRTNetClient.StartAcquiring())
                {
                    Debug.Log("StartAcq success");

                    uint numMarkers = CodaRTNetClient.getMaxMarkers();

                    for (uint i = 0; i < numMarkers; i++)
                    {
                        var player = GameObject.Instantiate(_playerPrefab);
                        player.SetMarkerID(i + 1);
                    }

                    started = true;
                    if (updateInvokeRepeating)
                    {
                        InvokeRepeating("CodaFrameUpdate", 1.0f, 0.001f);
                    }
                }
            }
        }
Exemple #2
0
 void OnDisable()
 {
     if (started)
     {
         CodaRTNetClient.StopAcquiring();
         CodaRTNetClient.StopSystem();
         Debug.Log("Client Closed");
         started = false;
     }
 }
Exemple #3
0
 void CodaFrameUpdate()
 {
     if (started && updateInvokeRepeating)
     {
         var markerFrame = CodaRTNetClient.GetLatestFrame();
         if (markerFrame != null)
         {
             this.markerFrame = markerFrame;
         }
     }
 }