예제 #1
0
    // // // // // // // // // // // // // // // // // // // //

    // Use this for initialization
    public void Start()
    {
        Debug.Log("Devices :: Start");
        accelDataCounter = 0;
        gyroDataCounter  = 0;

        //Initializer code -START
        GameObject lmObj = GameObject.Find("LinkManager");

        if (lmObj == null)
        {
            lmObj = new GameObject("LinkManager");
            lmObj.AddComponent <NativeCommunication> ();
        }
        linkManager = lmObj.GetComponent <NativeCommunication> ();

        for (int loop = 0; loop < 500; loop++)
        {
            Constants.CalibratedData2 newc = new Constants.CalibratedData2();

            newc.accel_x = 0;
            newc.accel_y = 0;
            newc.accel_z = 0;

            calibratedList2.Add(newc);
        }
    }
예제 #2
0
    void Start()
    {
        Debug.Log("SensorManager Start()");
        statusText.text          = "";
        deviceSelectionText.text = "";

        nextButton.SetActive(false);

        //Initializer code -START
        statusText.text = "";
        GameObject lmObj = GameObject.Find("LinkManager");

        if (lmObj == null)
        {
            lmObj = new GameObject("LinkManager");
            lmObj.AddComponent <NativeCommunication> ();
        }
        linkManager             = lmObj.GetComponent <NativeCommunication> ();
        linkManager.snsrManager = this;


//        linkManager.OnAccelCalibrationDone += CalibrationComplete;

        //If sensor is already on.
        StopDevice();

        #if !UNITY_EDITOR
        StartDevice();
        #endif

        #if UNITY_EDITOR
        nextButton.SetActive(true);
        #endif
        //Initializer code -END
    }
예제 #3
0
    void Start()
    {
        lmObj = GameObject.Find("LinkManager");

        linkManager = lmObj.GetComponent <NativeCommunication> ();

        testRmaps = GameObject.Find("TestRmaps");
    }
예제 #4
0
        private void btImageProcess_Click(object sender, EventArgs e)
        {
            Image oldImage = pbMain.Image;
            NativeCommunication nativeCommunicator = new NativeCommunication();

            pbMain.Image = nativeCommunicator.ConvertImage(oldImage);
            pbMain.Invalidate();
            oldImage.Dispose();
        }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        GameObject lmObj = GameObject.Find("LinkManager");

        if (lmObj == null)
        {
            lmObj = new GameObject("LinkManager");
            lmObj.AddComponent <NativeCommunication> ();
        }
        linkManager = lmObj.GetComponent <NativeCommunication> ();
    }
예제 #6
0
    void Start()
    {
        GameObject lmObj = GameObject.Find("LinkManager");

        if (lmObj == null)
        {
            Debug.Log("didnt find link manager");
        }
        linkManager = lmObj.GetComponent <NativeCommunication> ();
//		linkManager.snsrManager.selectedPlayers.Clear ();
//		linkManager.snsrManager.playersDevices.Clear ();
    }
예제 #7
0
    void Start()
    {
        connectedDevicesCounter = 0;
        Debug.Log("Unity:: Initializer::1");
        GameObject lmObj = GameObject.Find("LinkManager");

        if (lmObj == null)
        {
            lmObj = new GameObject("LinkManager");
            lmObj.AddComponent <NativeCommunication> ();
        }
        linkManager = lmObj.GetComponent <NativeCommunication> ();
        linkManager.snsrManager.initGame = this;
        Debug.Log("Unity:: Initializer::2");
        linkManager.OnAccelCalibrationDone += CalibrationComplete;


        Debug.Log("Unity:: Initializer::3");

        GameObject tmpPersistent = GameObject.Find("PersistentPlayData");

        if (tmpPersistent == null)
        {
            tmpPersistent = new GameObject("PersistentPlayData");
            persistent    = tmpPersistent.AddComponent <PersistentPlayData> ();

            List <string> filenames = FileUtility.GetRmapList();

            for (int x = 0; x < filenames.Count; x++)
            {
                Debug.Log(filenames[x]);
            }

            filenames = FFD_Filter.FilterFiles(filenames, new string[1] {
                ".rmap"
            });

            if (filenames.Count == 0)
            {
                Debug.Log("NO RMAPS FOUND: " + persistent.rmapName);
                return;
            }

            //for(int x = 0; x<filenames.Count;x++){
            //	Debug.Log (filenames[x]);
            //}

            persistent.rmapName = Path.GetFileName(filenames [0]);
            //persistent.rmapName = "schedule"; //(this hardcodes name of rmap if needed)
        }
        else
        {
            persistent = tmpPersistent.GetComponent <PersistentPlayData> ();
        }


        if (persistent.rmapName.Contains("_2"))         //persistent.rmapName == "schedule.rmap")
        {
            player1Box.SetActive(true);
            player2Box.SetActive(true);
        }
        else
        {
            player1Box.SetActive(true);
            player2Box.SetActive(false);
        }


        #if !UNITY_EDITOR
        Debug.Log("Unity:: Initializer::4");
        Debug.Log("Unity:: Initializer:: start Device:: total players " + connectedDevicesCounter + " Device Serial : " + linkManager.snsrManager.selectedPlayers[connectedDevicesCounter]);
        StartDevice();
        #endif

        #if UNITY_EDITOR
        Invoke("CalibrationCompleteUnityEditor", 2.0f);
        #endif
    }
 public MainForm()
 {
     InitializeComponent();
     tbPath.Text        = "C:\\Users\\mateu\\Pictures\\Lenna.jpg";
     nativeCommunicator = new NativeCommunication();
 }