Showing
2 changed files
with
67 additions
and
9 deletions
... | @@ -379,7 +379,7 @@ GameObject: | ... | @@ -379,7 +379,7 @@ GameObject: |
379 | m_Icon: {fileID: 0} | 379 | m_Icon: {fileID: 0} |
380 | m_NavMeshLayer: 0 | 380 | m_NavMeshLayer: 0 |
381 | m_StaticEditorFlags: 0 | 381 | m_StaticEditorFlags: 0 |
382 | - m_IsActive: 1 | 382 | + m_IsActive: 0 |
383 | --- !u!224 &109009051 | 383 | --- !u!224 &109009051 |
384 | RectTransform: | 384 | RectTransform: |
385 | m_ObjectHideFlags: 0 | 385 | m_ObjectHideFlags: 0 |
... | @@ -701,7 +701,7 @@ GameObject: | ... | @@ -701,7 +701,7 @@ GameObject: |
701 | m_Icon: {fileID: 0} | 701 | m_Icon: {fileID: 0} |
702 | m_NavMeshLayer: 0 | 702 | m_NavMeshLayer: 0 |
703 | m_StaticEditorFlags: 0 | 703 | m_StaticEditorFlags: 0 |
704 | - m_IsActive: 1 | 704 | + m_IsActive: 0 |
705 | --- !u!224 &310358199 | 705 | --- !u!224 &310358199 |
706 | RectTransform: | 706 | RectTransform: |
707 | m_ObjectHideFlags: 0 | 707 | m_ObjectHideFlags: 0 |
... | @@ -772,7 +772,7 @@ GameObject: | ... | @@ -772,7 +772,7 @@ GameObject: |
772 | m_Icon: {fileID: 0} | 772 | m_Icon: {fileID: 0} |
773 | m_NavMeshLayer: 0 | 773 | m_NavMeshLayer: 0 |
774 | m_StaticEditorFlags: 0 | 774 | m_StaticEditorFlags: 0 |
775 | - m_IsActive: 1 | 775 | + m_IsActive: 0 |
776 | --- !u!224 &395084096 | 776 | --- !u!224 &395084096 |
777 | RectTransform: | 777 | RectTransform: |
778 | m_ObjectHideFlags: 0 | 778 | m_ObjectHideFlags: 0 |
... | @@ -1293,7 +1293,7 @@ GameObject: | ... | @@ -1293,7 +1293,7 @@ GameObject: |
1293 | m_Icon: {fileID: 0} | 1293 | m_Icon: {fileID: 0} |
1294 | m_NavMeshLayer: 0 | 1294 | m_NavMeshLayer: 0 |
1295 | m_StaticEditorFlags: 0 | 1295 | m_StaticEditorFlags: 0 |
1296 | - m_IsActive: 1 | 1296 | + m_IsActive: 0 |
1297 | --- !u!224 &1089006721 | 1297 | --- !u!224 &1089006721 |
1298 | RectTransform: | 1298 | RectTransform: |
1299 | m_ObjectHideFlags: 0 | 1299 | m_ObjectHideFlags: 0 |
... | @@ -1736,10 +1736,12 @@ MonoBehaviour: | ... | @@ -1736,10 +1736,12 @@ MonoBehaviour: |
1736 | mirror: 1 | 1736 | mirror: 1 |
1737 | move: 1 | 1737 | move: 1 |
1738 | lines: [] | 1738 | lines: [] |
1739 | + lines_right: [] | ||
1739 | trainer_i: -1 | 1740 | trainer_i: -1 |
1740 | trainer_j: 0 | 1741 | trainer_j: 0 |
1741 | trainer_data1: [] | 1742 | trainer_data1: [] |
1742 | trainer_state: | 1743 | trainer_state: |
1744 | + speed: 0 | ||
1743 | AngleLeftKnee: {fileID: 1313906998} | 1745 | AngleLeftKnee: {fileID: 1313906998} |
1744 | AngleRightKnee: {fileID: 1543390839} | 1746 | AngleRightKnee: {fileID: 1543390839} |
1745 | KneeToeLeft: {fileID: 2059169298} | 1747 | KneeToeLeft: {fileID: 2059169298} |
... | @@ -1790,7 +1792,7 @@ GameObject: | ... | @@ -1790,7 +1792,7 @@ GameObject: |
1790 | m_Icon: {fileID: 0} | 1792 | m_Icon: {fileID: 0} |
1791 | m_NavMeshLayer: 0 | 1793 | m_NavMeshLayer: 0 |
1792 | m_StaticEditorFlags: 0 | 1794 | m_StaticEditorFlags: 0 |
1793 | - m_IsActive: 1 | 1795 | + m_IsActive: 0 |
1794 | --- !u!224 &1484596776 | 1796 | --- !u!224 &1484596776 |
1795 | RectTransform: | 1797 | RectTransform: |
1796 | m_ObjectHideFlags: 0 | 1798 | m_ObjectHideFlags: 0 | ... | ... |
... | @@ -57,7 +57,8 @@ public class Move : MonoBehaviour | ... | @@ -57,7 +57,8 @@ public class Move : MonoBehaviour |
57 | string spinestraight, pullhipback, great; | 57 | string spinestraight, pullhipback, great; |
58 | 58 | ||
59 | string exercise; | 59 | string exercise; |
60 | - int squat_flag, squat_count; | 60 | + int workout_flag, workout_count, workout_flag2; |
61 | + bool workout; | ||
61 | private float timer; | 62 | private float timer; |
62 | 63 | ||
63 | public GameObject count3; | 64 | public GameObject count3; |
... | @@ -122,6 +123,13 @@ public class Move : MonoBehaviour | ... | @@ -122,6 +123,13 @@ public class Move : MonoBehaviour |
122 | } | 123 | } |
123 | //lsy end | 124 | //lsy end |
124 | 125 | ||
126 | + void Trainee_Count() { | ||
127 | + | ||
128 | + workout_count++; | ||
129 | + workout = false; | ||
130 | + | ||
131 | + } | ||
132 | + | ||
125 | void Start() | 133 | void Start() |
126 | { | 134 | { |
127 | timer = 0; | 135 | timer = 0; |
... | @@ -155,8 +163,10 @@ public class Move : MonoBehaviour | ... | @@ -155,8 +163,10 @@ public class Move : MonoBehaviour |
155 | Debug.Log("읽음"); | 163 | Debug.Log("읽음"); |
156 | } | 164 | } |
157 | 165 | ||
158 | - squat_count = 0; | 166 | + workout_count = 0; |
159 | - squat_flag = 0; | 167 | + workout_flag = 0; |
168 | + workout_flag2 = 0; | ||
169 | + workout = false; | ||
160 | 170 | ||
161 | HipBalance1.SetActive(false); | 171 | HipBalance1.SetActive(false); |
162 | PullHipBack2.SetActive(false); | 172 | PullHipBack2.SetActive(false); |
... | @@ -251,6 +261,7 @@ public class Move : MonoBehaviour | ... | @@ -251,6 +261,7 @@ public class Move : MonoBehaviour |
251 | Trainer_Run(); | 261 | Trainer_Run(); |
252 | //lsy end | 262 | //lsy end |
253 | 263 | ||
264 | + | ||
254 | IfSpineIsStraight.text = "허리를 곧게: Tracking"; | 265 | IfSpineIsStraight.text = "허리를 곧게: Tracking"; |
255 | HipBalance.text = "양쪽 힙 균형: Calculating"; | 266 | HipBalance.text = "양쪽 힙 균형: Calculating"; |
256 | AngleLeftKnee.text = ""; | 267 | AngleLeftKnee.text = ""; |
... | @@ -413,6 +424,17 @@ public class Move : MonoBehaviour | ... | @@ -413,6 +424,17 @@ public class Move : MonoBehaviour |
413 | Great5.SetActive(false); | 424 | Great5.SetActive(false); |
414 | } | 425 | } |
415 | 426 | ||
427 | + ////////////운동 횟수 카운트////////////////////// | ||
428 | + if (ReadAngles[3] < 95 && ReadAngles[4] < 95 && workout && workout_flag >= 95) | ||
429 | + { | ||
430 | + Trainee_Count(); | ||
431 | + } | ||
432 | + else | ||
433 | + { | ||
434 | + workout_flag = ReadAngles[3]; | ||
435 | + workout_flag2 = ReadAngles[4]; | ||
436 | + workout = true; | ||
437 | + } | ||
416 | 438 | ||
417 | } | 439 | } |
418 | else if (exercise == "SideHiKick") | 440 | else if (exercise == "SideHiKick") |
... | @@ -440,12 +462,22 @@ public class Move : MonoBehaviour | ... | @@ -440,12 +462,22 @@ public class Move : MonoBehaviour |
440 | else if (ReadAngles[8] >= 40) | 462 | else if (ReadAngles[8] >= 40) |
441 | { | 463 | { |
442 | Great5.SetActive(true); //Great | 464 | Great5.SetActive(true); //Great |
443 | - | ||
444 | } | 465 | } |
445 | else | 466 | else |
446 | { | 467 | { |
447 | Great5.SetActive(false); | 468 | Great5.SetActive(false); |
448 | } | 469 | } |
470 | + | ||
471 | + ////////운동 횟수 카운트//////////////////// | ||
472 | + if (ReadAngles[7] > 40 && workout && workout_flag <= 40) | ||
473 | + { | ||
474 | + Trainee_Count(); | ||
475 | + } | ||
476 | + else | ||
477 | + { | ||
478 | + workout_flag = ReadAngles[7]; | ||
479 | + workout = true; | ||
480 | + } | ||
449 | } | 481 | } |
450 | else if (exercise == "Lunge") | 482 | else if (exercise == "Lunge") |
451 | { | 483 | { |
... | @@ -460,6 +492,28 @@ public class Move : MonoBehaviour | ... | @@ -460,6 +492,28 @@ public class Move : MonoBehaviour |
460 | great = ""; | 492 | great = ""; |
461 | Great5.SetActive(false); | 493 | Great5.SetActive(false); |
462 | } | 494 | } |
495 | + | ||
496 | + //////////////운동 횟수 카운트////////////////// | ||
497 | + //왼쪽 | ||
498 | + if (ReadAngles[3] < 95 && workout && workout_flag >= 95) | ||
499 | + { | ||
500 | + Trainee_Count(); | ||
501 | + } | ||
502 | + else | ||
503 | + { | ||
504 | + workout_flag = ReadAngles[3]; | ||
505 | + workout = true; | ||
506 | + } | ||
507 | + //오른쪽 | ||
508 | + if (ReadAngles[4] < 95 && workout && workout_flag >= 95) | ||
509 | + { | ||
510 | + Trainee_Count(); | ||
511 | + } | ||
512 | + else | ||
513 | + { | ||
514 | + workout_flag = ReadAngles[4]; | ||
515 | + workout = true; | ||
516 | + } | ||
463 | } | 517 | } |
464 | 518 | ||
465 | //공통된 사항 | 519 | //공통된 사항 |
... | @@ -474,6 +528,8 @@ public class Move : MonoBehaviour | ... | @@ -474,6 +528,8 @@ public class Move : MonoBehaviour |
474 | SpineStraight4.SetActive(false); | 528 | SpineStraight4.SetActive(false); |
475 | } | 529 | } |
476 | 530 | ||
531 | + | ||
532 | + | ||
477 | IfSpineIsStraight.text =spinestraight; | 533 | IfSpineIsStraight.text =spinestraight; |
478 | HipBalance.text = hipbal; | 534 | HipBalance.text = hipbal; |
479 | //AngleLeftKnee.text = "왼쪽 무릎 각도: " + ReadAngles[3].ToString(); | 535 | //AngleLeftKnee.text = "왼쪽 무릎 각도: " + ReadAngles[3].ToString(); | ... | ... |
-
Please register or login to post a comment