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(); }
public void Sound_Controller() { if (judgment[0] + judgment[1] == 2) { if (DumbelCoordinator.lang == "kr") { MSGorder = 3; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 11; } } else if (judgment[0] == 1) { if (DumbelCoordinator.lang == "kr") { MSGorder = 5; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 13; } } else if (judgment[1] == 1) { if (DumbelCoordinator.lang == "kr") { MSGorder = 6; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 14; } } else if (judgment[0] + judgment[1] + judgment[2] + judgment[3] + judgment[4] + judgment[5] == 0) { if (DumbelCoordinator.lang == "kr") { MSGorder = 2; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 10; } } if (end_Flag) { if (!SideCoordinator.practice_On) { sideCoordi.send2web(score_Count, judgment); sideCoordi.msg2Web("from Unity score_count" + score_Count.ToString() + "/" + "clear_count" + clear_Score.ToString()); if ((clear_Score - 1) == score_Count) { sideCoordi.firewall(); SideCoordinator.firewall_position = new Vector3(((SideCoordinator.JointInfo["FootLeft"].X + SideCoordinator.JointInfo["FootRight"].X) / 2), ((SideCoordinator.JointInfo["FootLeft"].Y) * 6)); SideCoordinator.firewall_obj.transform.position = SideCoordinator.firewall_position; SideCoordinator.firewall_obj.SetActive(true); if (DumbelCoordinator.lang == "kr") { MSGorder = 4; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 12; } } else if ((clear_Score - 2) == score_Count) { if (DumbelCoordinator.lang == "kr") { MSGorder = 0; } else if (DumbelCoordinator.lang == "jp") { MSGorder = 8; } } else if ((clear_Score - 3) == score_Count) { //MSGorder = 8; } else if ((clear_Score == score_Count)) { GameObject.Destroy(SideCoordinator.firewall_obj); SideCoordinator.particle_position = new Vector3(((SideCoordinator.JointInfo["FootLeft"].X + SideCoordinator.JointInfo["FootRight"].X) / 2), ((SideCoordinator.JointInfo["FootLeft"].Y) * 7)); SideCoordinator.particle.transform.position = SideCoordinator.particle_position; SideCoordinator.particle.SetActive(true); SideCoordinator.changeAni("greet_03"); score_Count = 0; set_Count++; SideCoordinator.set_time = SideCoordinator.set_timer.Elapsed.ToString().Substring(3, 5); //Debug.Log(SideCoordinator.set_time); //MSGorder = 6; } } } //Debug.Log("EndClear"); }
void endCheck() { SideCoordinator.current_phase = 4; if (armpit_Left_Angle <= 40) { SideCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.black; wristLeftAngle_Check = true; } else { SideCoordinator.armpLeftDegree.GetComponent <Text>().color = Color.red; wristLeftAngle_Check = false; } if (armpit_Right_Angle <= 40) { SideCoordinator.armpRightDegree.GetComponent <Text>().color = Color.black; wristRightAngle_Check = true; } else { SideCoordinator.armpRightDegree.GetComponent <Text>().color = Color.red; wristRightAngle_Check = false; } if (wristLeftAngle_Check && wristRightAngle_Check) { judgment_position(); GameObject PointsText; int ct = 0; UnityEngine.Debug.Log("Arm Check"); for (int i = 0; i < 2; i++) { UnityEngine.Debug.Log("LeftArm[" + i + "]" + LeftArmDepth[i]); UnityEngine.Debug.Log("RightArm[" + i + "]" + RightArmDepth[i]); if (!LeftArmDepth[i]) { ct++; } if (!RightArmDepth[i]) { ct++; } } //UnityEngine.Debug.Log("CT = " + ct); if (ct == 0) { if (SideCoordinator.practice_On) { practice_count++; } PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/yosi")) as GameObject; //Debug.Log("yosi"); SideCoordinator.changeAni("greet_03"); } else if (ct == 1) { PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/soso")) as GameObject; SideCoordinator.changeAni("pose_00"); } else { PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/bad")) as GameObject; SideCoordinator.changeAni("refuse_01"); bad_count++; //Debug.Log("BAD"); } PointsText.GetComponent <ParticleSystem>().loop = false; show_pointText(PointsText); end_Flag = true; if (SideCoordinator.practice_On) { //Debug.Log(practice_count); if (practice_count > 1) { practice_count = 0; bad_count = 0; sideCoordi.ResumeScreen(); } } else { if (score_Count > 2 || set_Count != 0) { if (SideCoordinator.count_timer.ElapsedMilliseconds + 2000 > SideCoordinator.count_time_avg) { //Debug.Log("SLOW!!"); SideCoordinator.changeAni("nod_01"); //MSGorder = 5; } else { SideCoordinator.count_time_avg = (SideCoordinator.count_time_avg + SideCoordinator.count_timer.ElapsedMilliseconds) / score_Count; } //Debug.Log(SideCoordinator.count_timer.ElapsedMilliseconds + " / " + SideCoordinator.count_time_avg); } score_Count++; //if(status board is deactivate if (!SideCoordinator.Status.activeInHierarchy) { SideCoordinator.Status.SetActive(true); } //set board txt clearBoard(); setBoard(); //clear MuscleFail LeftArmMuscle[0] = true; LeftArmMuscle[1] = true; RightArmMuscle[0] = true; RightArmMuscle[1] = true; SideCoordinator.count_timer.Reset(); } Sound_Controller(); clearFail(); ready_Flag = false; start_Flag = false; top_Flag = false; end_Flag = false; sideCoordi.msg2Web("re:" + ready_Flag + " /st:" + start_Flag + " /tp:" + top_Flag + " /en:" + end_Flag); sideCoordi.msg2Web("after send" + score_Count); //Floating Text //GameObject PointsText = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Kinniku")) as GameObject; //PointsText.transform.position = new Vector3(SideCoordinator.JointInfo["SpineShoulder"].X, SideCoordinator.JointInfo["SpineShoulder"].Y); if (!SideCoordinator.practice_On && bad_count > 2) { sideCoordi.SplitScreen(); } } }