// Update is called once per frame
    void Update()
    {
        if (text.color.a < 1.0f)
        {
            text.color = new Color(text.color.r, text.color.g, text.color.b, text.color.a + (Time.deltaTime / 3.0f));
        }

        //serial port로 데이터 보내기
        try{
            SPHandler.SendString(end_string);
        }
        catch (Exception e) {
            Debug.Log(e);
        }
        Debug.Log("Send End_string");

        //udp로 데이터 보내기
        try{
            UHandler.SendString("1");
            UHandler.StopThread();
        }
        catch (Exception e) {
            Debug.Log(e);
        }



        if (text.color.a >= 1.0f)
        {
            SceneManager.LoadScene("MainMenu_0");
        }
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        if (timer > waiting_time)
        {
            //serial port로 데이터 보내기
            try{
                SPHandler.SendString(start_string);
            }
            catch (Exception e) {
                Debug.Log(e);
            }

            //udp로 데이터 보내기
            try{
                UHandler.SendString("s");
            }
            catch (Exception e) {
                Debug.Log(e);
            }


            //Serial으로 데이터 받기
            if (SPHandler.IsConnected() && !sp)
            {
                progressBar.value += (float)0.5;
                sp = true;
            }

            //udp로 데이터 받기
            if (UHandler.newData && !up)
            {
                progressBar.value += (float)0.5;
                up = true;
            }

            if (progressBar.value >= max)
            {
                SceneManager.LoadScene("GameScene");
            }

            timer = 0;
        }
    }