コード例 #1
0
    public void Start()
    {
        t = false;
        current_time_movement = 0;
        var go = gameObject;

        if (GlobalController.patientOrPhysio)
        {
            GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
            GetMovementPoints.SavePoints(GlobalController.choiceAvatar,
                                         "/Movimentos/",
                                         GlobalController.instance.movement.pontosMovimento,
                                         mao,
                                         cotovelo,
                                         ombro,
                                         braco,
                                         true);
        }
        else
        {
            GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c3);
            GetMovementPoints.SavePoints(GlobalController.choiceAvatar,
                                         "/Exercicios/",
                                         GlobalController.instance.exercise.pontosExercicio,
                                         mao,
                                         cotovelo,
                                         ombro,
                                         braco,
                                         true);
        }

        Assign();
    }
    public void FixedUpdate()
    {
        if (t)
        {
            current_time_movement += Time.fixedDeltaTime;

            if (GlobalController.patientOrPhysio)
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Movimentos/",
                                             GlobalController.instance.movement.pontosMovimento,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco);
            }
            else
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Exercicios/",
                                             GlobalController.instance.exercise.pontosExercicio,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco);
            }

            if (current_time_movement >= 15f)
            {
                t = false;
            }

            GetMovementPoints.graphSpawner(transform, pointPrefab, mao, cotovelo, ombro, current_time_movement, ref lineRenderer);
        }
    }
コード例 #3
0
 public IEnumerator drawGraphic()
 {
     for (int j = 0; j < current_time.Count; ++j)
     {
         GetMovementPoints.graphSpawner(transform, pointPrefab, mao, cotovelo, ombro, current_time[j], ref lineRenderer);
         yield return(new WaitForSeconds(0.025f));
     }
 }
コード例 #4
0
    /**
     * Descrever aqui o que esse método realiza.
     */
    void Start()
    {
        if (GlobalController.instance != null &&
            GlobalController.instance.movement != null)
        {
            t      = false;
            drawed = false;

            current_time   = new List <float>();
            f_mao_pos      = new List <Vector3>();
            f_mao_rot      = new List <Vector3>();
            f_ombro_pos    = new List <Vector3>();
            f_ombro_rot    = new List <Vector3>();
            f_cotovelo_pos = new List <Vector3>();
            f_cotovelo_rot = new List <Vector3>();
            f_braco_pos    = new List <Vector3>();
            f_braco_rot    = new List <Vector3>();

            var currentscene = SceneManager.GetActiveScene().name;
            var go           = gameObject;

            if (currentscene == "GraphsMovimentoPhysio")
            {
                string   file = Application.dataPath + "/Movimentos/" + GlobalController.instance.movement.pontosMovimento;
                string[] p1   = System.IO.File.ReadAllLines(file);
                LoadData(p1);
                Assign();
                GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
            }
            else
            {
                if (transform.root.gameObject.name == "Grafico Fisio")
                {
                    string   file = Application.dataPath + "/Movimentos/" + GlobalController.instance.movement.pontosMovimento;
                    string[] p1   = System.IO.File.ReadAllLines(file);
                    LoadData(p1);
                    Assign();
                    GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
                }
                else
                {
                    string   file = Application.dataPath + "/Exercicios/" + GlobalController.instance.exercise.pontosExercicio;
                    string[] p1   = System.IO.File.ReadAllLines(file);
                    LoadData(p1);
                    Assign();
                    GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c3);
                }
            }
        }
        else
        {
            Debug.Log("Você violou o acesso!");
        }
    }
    public void Awake()
    {
        t = false;
        current_time_movement = 0;
        var go = gameObject;

        if (GlobalController.patientOrPhysio)
        {
            GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
        }
        else
        {
            GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c3);
        }
    }
コード例 #6
0
    public void FixedUpdate()
    {
        if (t)
        {
            client.BeginReceive(new AsyncCallback(ReceiveServerInfo), null);

            current_time_movement += Time.fixedDeltaTime;

            ombro.localPosition    = f_ombro_pos;
            ombro.localEulerAngles = f_ombro_rot;

            braco.localPosition    = f_braco_pos;
            braco.localEulerAngles = f_braco_rot;

            cotovelo.localPosition    = f_cotovelo_pos;
            cotovelo.localEulerAngles = f_cotovelo_rot;

            mao.localPosition    = f_mao_pos;
            mao.localEulerAngles = f_mao_rot;

            if (GlobalController.patientOrPhysio)
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Movimentos/",
                                             GlobalController.instance.movement.pontosMovimento,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco);
            }
            else
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Exercicios/",
                                             GlobalController.instance.exercise.pontosExercicio,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco);
            }

            GetMovementPoints.graphSpawner(transform, pointPrefab, mao, cotovelo, ombro, current_time_movement, ref lineRenderer);
            if (current_time_movement > 15)
            {
                t = false;
            }
        }
    }
コード例 #7
0
 /**
  * Descrever aqui o que esse método realiza.
  */
 void Awake()
 {
     if (GlobalController.instance != null &&
         (GlobalController.instance.movement != null ||
          GlobalController.instance.exercise != null)
         )
     {
         t = false;
         var go = gameObject;
         current_time_movement = 0;
         if (GlobalController.patientOrPhysio)
         {
             GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
             GetMovementPoints.SavePoints(GlobalController.choiceAvatar,
                                          "/Movimentos/",
                                          GlobalController.instance.movement.pontosMovimento,
                                          mao,
                                          cotovelo,
                                          ombro,
                                          braco,
                                          true);
         }
         else
         {
             GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c3);
             GetMovementPoints.SavePoints(GlobalController.choiceAvatar,
                                          "/Exercicios/",
                                          GlobalController.instance.exercise.pontosExercicio,
                                          mao,
                                          cotovelo,
                                          ombro,
                                          braco,
                                          true);
         }
     }
     else
     {
         Debug.Log("Você violou o acesso!");
     }
 }
コード例 #8
0
 /**
  * Descrever aqui o que esse método realiza.
  */
 void Awake()
 {
     if (GlobalController.instance != null &&
         (GlobalController.instance.movement != null ||
          GlobalController.instance.exercise != null)
         )
     {
         t = false;
         var go = gameObject;
         current_time_movement = 0;
         if (GlobalController.patientOrPhysio)
         {
             GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c2);
         }
         else
         {
             GetMovementPoints.LoadLineRenderer(ref go, ref lineRenderer, c1, c3);
         }
     }
     else
     {
         Debug.Log("Você violou o acesso!");
     }
 }
コード例 #9
0
    public void FixedUpdate()
    {
        if (!udpSocketManager.isInitializationCompleted())
        {
            Debug.Log("Initialization Completed");
            return;
        }

        if (!isListenPortLogged)
        {
            IPHostEntry hostInfo = Dns.GetHostByName(Dns.GetHostName());
            Console.WriteLine("Host name : " + hostInfo.HostName);
            Console.WriteLine("IP address List : ");

            for (int index = 0; index < hostInfo.AddressList.Length; index++)
            {
                if (hostInfo.AddressList[index].AddressFamily == AddressFamily.InterNetwork)
                {
                    currentIPV4 = string.Format("{0}", hostInfo.AddressList[index]);
                }
            }

            Debug.Log("UdpSocketManager, listen port: " + udpSocketManager.getListenPort());
            connectionInformation.text = string.Format("{1}:{0}", udpSocketManager.getListenPort(), currentIPV4);
            isListenPortLogged         = true;

            GlobalController.showQrCode = true;
        }

        if (receivedAnyMessage)
        {
            connectionInformation.text = "";
        }

        foreach (byte[] recPacket in udpSocketManager.receive())
        {
            receivedAnyMessage = true;

            string receivedMsg = Encoding.UTF8.GetString(recPacket);

            LoadData(receivedMsg);

            //Debug.Log(receivedMsg);
        }


        if (t)
        {
            current_time_movement += Time.fixedDeltaTime;

            ombro.localPosition    = f_ombro_pos;
            ombro.localEulerAngles = f_ombro_rot;

            braco.localPosition    = f_braco_pos;
            braco.localEulerAngles = f_braco_rot;

            cotovelo.localPosition    = f_cotovelo_pos;
            cotovelo.localEulerAngles = f_cotovelo_rot;

            mao.localPosition    = f_mao_pos;
            mao.localEulerAngles = f_mao_rot;

            if (GlobalController.patientOrPhysio)
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Movimentos/",
                                             GlobalController.instance.movement.pontosMovimento,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco,
                                             false);
            }
            else
            {
                GetMovementPoints.SavePoints(current_time_movement,
                                             "/Exercicios/",
                                             GlobalController.instance.exercise.pontosExercicio,
                                             mao,
                                             cotovelo,
                                             ombro,
                                             braco,
                                             false);
            }

            GetMovementPoints.graphSpawner(transform, pointPrefab, mao, cotovelo, ombro, current_time_movement, ref lineRenderer);
            if (current_time_movement > 15)
            {
                t = false;
            }
        }
    }