Ejemplo n.º 1
0
    void Awake()
    {
        if (_instance == null)
        {
            //If I am the first instance, keep track of me
            _instance = this;
            //DontDestroyOnLoad(this);
            Debug.Log("Initialed");
        }
        else
        {
            //If a Singleton already exists and you find another reference in scene, destroy it.
            if (this != _instance)
            {
                Debug.Log("ERROR!!!!  You have more than one instance of the Motion Capture Streaming Receiver in your scene.  There can be only one.  Anything that happens from this point on may be weird.");
                //Destroy(this.gameObject);
            }
        }

        if (mocapServer == MocapServer.Cube_QualisysTrackManager)
        {
            QTMInterface = transform.Find("Qualisys_DoNotEdit").GetComponent <QTMInterface> ();
            QTMInterface.gameObject.SetActive(true);
            QTMInterface.Initialize(QTMserverIP, QTMserverPort, QTMlocalPort);
        }
        else if (mocapServer == MocapServer.Perform_OptitrackMotiveBody)
        {
            OMBInterface = transform.Find("Optitrack_DoNotEdit").GetComponent <OptitrackStreamingClient> ();
            OMBInterface.gameObject.SetActive(true);
            OMBInterface.Initialize(OMBlocalAddress, OMBserverAddress, OMBdataPort, OMBcommandPort);
        }
    }
Ejemplo n.º 2
0
 void Awake()
 {
     if (_instance == null)
     {
         //If I am the first instance, keep track of me
         _instance = this;
         //DontDestroyOnLoad(this);
     }
     else
     {
         //If a Singleton already exists and you find another reference in scene, destroy it.
         if (this != _instance)
         {
             Debug.Log("ERROR!!!!  You have more than one instance of the Motion Capture Streaming Receiver in your scene.  There can be only one.  Anything that happens from this point on may be weird.");
             //Destroy(this.gameObject);
         }
     }
 }
 void OnEnable()
 {
     // get reference to the script whose inspector we are editing
     script = (MotionCaptureStreamingReceiver)target;
 }