Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 void OnDisable()
 {
     if (started)
     {
         CodaRTNetClient.StopAcquiring();
         CodaRTNetClient.StopSystem();
         Debug.Log("Client Closed");
         started = false;
     }
 }
Ejemplo n.º 3
0
 void CodaFrameUpdate()
 {
     if (started && updateInvokeRepeating)
     {
         var markerFrame = CodaRTNetClient.GetLatestFrame();
         if (markerFrame != null)
         {
             this.markerFrame = markerFrame;
         }
     }
 }