Пример #1
0
    // Update is called once per frame
    void Update()
    {
        // For getting the data of epoc

        theClient.GetOpenvibeAnalog(out analogTS, out numOfChannels, out signal);
        // Timer
        timeCount += Time.deltaTime;
        if (TrainingController.mode == 0 || TrainingController.mode == 1)
        {
            if (timeCount > trainningTime && stimForTrain)
            {
                Debug.Log("Time is up, Trainning is finished!");
                theClient.PutOpenvibeButton(0); // theClient.Press(buttonIndexNum);
                stimForTrain = false;
            }
        }

        if (TrainingController.mode == 2)
        {
            buttonIndexNum = 1;
            if (timeCount > trainningTime && stimForTrain)
            {
                Debug.Log("Time is up, Trainning is finished!");
                theClient.PutOpenvibeButton(0); // theClient.Press(buttonIndexNum);
                stimForTrain = false;
            }
        }
    }
Пример #2
0
    int buttonIndexNum = 3;   // End condition is 3.


    void OnTriggerEnter()
    {
        // Stimulate when the game is over.
        CarDefault.Pause();
        NameText.GetComponent <Text>().enabled = false;
        FinishPanel.SetActive(true);

        CarControls.SetActive(true);

        var Client = GameObject.Find("PressController").GetComponent <ForPress>();

        Debug.Log("Individual is finished!");
        theClient = Client.theClient;

        theClient.PutOpenvibeButton(0); // theClient.Press(buttonIndexNum);

        FinalPanelManager.MinuteCount = LapTimeManager.MinuteCount;
        FinalPanelManager.SecondCount = LapTimeManager.SecondCount;
        FinalPanelManager.MilliCount  = LapTimeManager.MilliCount;

        LapTimeManager.MinuteCount = 0;
        LapTimeManager.SecondCount = 0;
        LapTimeManager.MilliCount  = 0;

        HalfLapTrig.SetActive(true);
        LapCompleteTrig.SetActive(false);


        //FinishText.GetComponent<Text>().text = "FINISH";
        //FinishText.SetActive(true);
    }
Пример #3
0
    int buttonIndexNum = 3;   // End condition is 3.


    void OnTriggerEnter()
    {
        CarDefault.Pause();
        NameText.GetComponent <Text>().enabled = false;
        FinishPanel.SetActive(true);

        CarControls.SetActive(true);

        var Client = GameObject.Find("PressController").GetComponent <ForPress>();

        Debug.Log("Individual is finished!");
        theClient = Client.theClient;

        theClient.PutOpenvibeButton(0);  // Client.theClient.Press(buttonIndexNum);

        FinalPanelManager_auto.MinuteCount = LapTimeManager_auto.MinuteCount;
        FinalPanelManager_auto.SecondCount = LapTimeManager_auto.SecondCount;
        FinalPanelManager_auto.MilliCount  = LapTimeManager_auto.MilliCount;

        textValue = LapTimeManager_auto.MinuteCount + ":" + LapTimeManager_auto.SecondCount + ":" + LapTimeManager_auto.MilliCount;
        System.IO.File.WriteAllText(savePath, textValue, Encoding.Default);

        LapTimeManager_auto.MinuteCount = 0;
        LapTimeManager_auto.SecondCount = 0;
        LapTimeManager_auto.MilliCount  = 0;

        HalfLapTrig.SetActive(true);
        LapCompleteTrig.SetActive(false);
    }
Пример #4
0
    void OnTriggerEnter(Collider Car2)
    {
        if (Car2.tag == "Car2")
        {
            Triggered2p = true;
            FinishText.SetActive(true);
            CarControls2.SetActive(true);

            // Stimulate when the game is over.
            var Client = GameObject.Find("PressController").GetComponent <ForPress>();
            theClient = Client.theClient;
            FinishPanelManager_com.MinuteCountBest2p = LapTimeManager2_com.MinuteCount2p;
            FinishPanelManager_com.SecondCountBest2p = LapTimeManager2_com.SecondCount2p;
            FinishPanelManager_com.MilliCountBest2p  = LapTimeManager2_com.MilliCount2p;

            textValue = LapTimeManager2_com.MinuteCount2p + ":" + LapTimeManager2_com.SecondCount2p + ":" + LapTimeManager2_com.MilliCount2p;
            System.IO.File.WriteAllText(savePath, textValue, Encoding.Default);
            // var Trig1P = GameObject.Find("LapCompleteTrigger").GetComponent<LapCompleteTrigger_com>();

            if (LapCompleteTrigger_com.Triggered1p == true)
            {
                FinishPanel.SetActive(true);
                NameText1.GetComponent <Text>().enabled = false;
                NameText2.GetComponent <Text>().enabled = false;

                Debug.Log("COmpetition is finished!");
                theClient.PutOpenvibeButton(0);  // theClient.Press(buttonIndexNum);
            }



            LapTimeManager2_com.MinuteCount2p = 0;
            LapTimeManager2_com.SecondCount2p = 0;
            LapTimeManager2_com.MilliCount2p  = 0;

            HalfLapTrig.SetActive(true);
            LapCompleteTrig.SetActive(false);



            FinishText.SetActive(true);
        }
    }