Exemplo n.º 1
0
    public void depth_Check()
    {
        if ((SideCoordinator.JointInfo["ShoulderLeft"].Z - SideCoordinator.JointInfo["ElbowLeft"].Z) <= 0.14f)
        {
            ElbowLeftDepthCheck = true;
        }
        else
        {
            ElbowLeftDepthCheck = false;
        }

        if ((SideCoordinator.JointInfo["ShoulderRight"].Z - SideCoordinator.JointInfo["ElbowRight"].Z) <= 0.14f)
        {
            ElbowRightDepthCheck = true;
        }
        else
        {
            ElbowRightDepthCheck = false;
        }

        if ((SideCoordinator.JointInfo["ShoulderLeft"].Z - SideCoordinator.JointInfo["WristLeft"].Z) <= 0.2f)
        {
            WristLeftDepthCheck = true;
        }
        else
        {
            WristLeftDepthCheck = false;
        }

        if ((SideCoordinator.JointInfo["ShoulderRight"].Z - SideCoordinator.JointInfo["WristRight"].Z) <= 0.2f)
        {
            WristRightDepthCheck = true;
        }
        else
        {
            WristRightDepthCheck = false;
        }


        if (!ElbowLeftDepthCheck && !ElbowRightDepthCheck)
        {
            if (SideCoordinator.lang == "kr")
            {
                failed_message = "양팔이 너무 앞으로 나왔어요";
            }
            else
            {
                failed_message = "両腕が前に出ました";
            }
        }
        else if (!ElbowLeftDepthCheck && ElbowRightDepthCheck)
        {
            if (SideCoordinator.lang == "kr")
            {
                failed_message = "왼팔이 너무 앞으로 나왔어요";
            }
            else
            {
                failed_message = "左腕が前に出ました";
            }
        }
        else if (ElbowLeftDepthCheck && !ElbowRightDepthCheck)
        {
            if (SideCoordinator.lang == "kr")
            {
                failed_message = "오른팔이 너무 앞으로 나왔어요";
            }
            else
            {
                failed_message = "右腕が前に出ました";
            }
        }

        else
        {
            failed_message = "";

            if (armpit_Left_Angle < 55 && armpit_Right_Angle < 55)
            {
                if (start_Flag && !top_Flag && (armpit_Left_Angle <= 100 || armpit_Right_Angle <= 100))
                {
                    if (SideCoordinator.lang == "kr")
                    {
                        failed_message = "잠깐!!! 팔을 더 올리셔야죠!!";
                    }
                    else
                    {
                        failed_message = "腕をもっと上げてください";
                    }
                }
            }
        }


        if (failed_message.Length != 0)
        {
            SideCoordinator.changeAni("refuse_01");
            SideCoordinator.setBallonText(failed_message);
        }
        else
        {
            //SideCoordinator.setBallonText("잘 하고 있어요!");
            SideCoordinator.setBallonText("");
            SideCoordinator.changeAni("nod_01");
        }
        record_mistake();
    }