Example #1
0
    private IEnumerator keySend(string keyboardInput)
    {
        Debug.Log(keyboardInput);
        yield return(new WaitForSeconds(0.1f));

        ct.Send(keyboardInput);
    }
Example #2
0
    void SendTargetAngle()      //***** Send 'target angle' to PC:  Function ~
    {
        isSend = false;
        /// yield return new WaitForSeconds(1);
        string send_msg = theta_user[0].ToString("f4") + "," + theta_user[1].ToString("f4") + "," + theta_user[2].ToString("f4") + "," + theta_user[3].ToString("f4") + "," + theta_user[4].ToString("f4") + "," + theta_user[5].ToString("f4") + ",999.9999";

        ct.Send(send_msg);
        isSend = true;
    }
Example #3
0
    private IEnumerator SendTargetAngle()      //***** Send 'target angle' to PC:  Function ~
    {
        isSend = false;
        yield return(new WaitForSeconds(0.1F));

        string send_msg = theta_user[0].ToString("f4") + "," + theta_user[1].ToString("f4") + "," + theta_user[2].ToString("f4") + "," + theta_user[3].ToString("f4") + "," + theta_user[4].ToString("f4") + "," + theta_user[5].ToString("f4") + ",999.9999";

        if (Robot_jR.inRange)            //*** if(OutOfRange) don't send!
        {
            ct.Send(send_msg);
            Debug.Log("Send raw" + send_msg);
        }
        isSend = true;
    }
Example #4
0
    private IEnumerator delaySend()
    {
        //str = count.ToString();
        isSend = false;
        yield return(new WaitForSeconds(1));

        ct.Send("1,1,1,1");
        Debug.Log("sented");

        //ct.Send(str);

        //count++;

        isSend = true;
    }
Example #5
0
    private IEnumerator delaySend()
    {
        isSend = false;
        // yield return new WaitForSeconds(1);
        yield return(new WaitForSeconds(0.1F));

        // ct.Send("Hello~ My name is Client");

        // Ting
        string sendmes = JsonUtility.ToJson(PlayerParam.Client);

        // string sendmes = JsonUtility.ToJson(ss);
        ct.Send(sendmes);

        PlayerParam.Client.Ball_Force_UpdateSt = false;

        PlayerParam.Client.Ball_Force_X = 0;
        PlayerParam.Client.Ball_Force_Y = 0;

        PlayerParam.Client.Ball_Velocity_X = 0;
        PlayerParam.Client.Ball_Velocity_Y = 0;

        isSend = true;
    }
Example #6
0
    private IEnumerator SendTargetAngle()      //***** Send 'target angle' to PC:  Function ~
    {
        isSend = false;
        yield return(new WaitForSeconds(0.01F));

        string send_msg = theta_user[0].ToString("f4") + "," + theta_user[1].ToString("f4") + "," + theta_user[2].ToString("f4") + "," + theta_user[3].ToString("f4") + "," + theta_user[4].ToString("f4") + "," + theta_user[5].ToString("f4") + "," + Robot_jR.theta_tar[6].ToString("f4") + "\0";

        //string send_msg = theta_user[0].ToString("f4") + "," + theta_user[1].ToString("f4") + "," + theta_user[2].ToString("f4") + "," + theta_user[3].ToString("f4") + ","+ theta_user[4].ToString("f4") + "," + theta_user[5].ToString("f4") + ",999.9999";
        if (Robot_jR.inRange & (ctrl_tpad_flag | ctrl_grip_flag))            //*** if(OutOfRange) don't send!
        {
            ct.Send(send_msg);

            if (ctrl_tpad_flag)
            {
                ctrl_tpad_flag = false;                  //0508_Pick&Place//
            }
            if (ctrl_grip_flag)
            {
                ctrl_grip_flag = false;
            }
            Debug.Log("Send raw" + send_msg);
        }
        isSend = true;
    }
Example #7
0
 public void SendInput()
 {
     ct.Send(Keyin.text);
 }
Example #8
0
 private void OnApplicationQuit()
 {
     ct.Send("bye");
     ct.StopConnect();
 }