Showing
2 changed files
with
164 additions
and
53 deletions
... | @@ -209,7 +209,7 @@ GameObject: | ... | @@ -209,7 +209,7 @@ GameObject: |
209 | m_Icon: {fileID: 0} | 209 | m_Icon: {fileID: 0} |
210 | m_NavMeshLayer: 0 | 210 | m_NavMeshLayer: 0 |
211 | m_StaticEditorFlags: 0 | 211 | m_StaticEditorFlags: 0 |
212 | - m_IsActive: 1 | 212 | + m_IsActive: 0 |
213 | --- !u!224 &64300835 | 213 | --- !u!224 &64300835 |
214 | RectTransform: | 214 | RectTransform: |
215 | m_ObjectHideFlags: 0 | 215 | m_ObjectHideFlags: 0 |
... | @@ -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: 0 | 382 | + m_IsActive: 1 |
383 | --- !u!224 &109009051 | 383 | --- !u!224 &109009051 |
384 | RectTransform: | 384 | RectTransform: |
385 | m_ObjectHideFlags: 0 | 385 | m_ObjectHideFlags: 0 |
... | @@ -450,7 +450,7 @@ GameObject: | ... | @@ -450,7 +450,7 @@ GameObject: |
450 | m_Icon: {fileID: 0} | 450 | m_Icon: {fileID: 0} |
451 | m_NavMeshLayer: 0 | 451 | m_NavMeshLayer: 0 |
452 | m_StaticEditorFlags: 0 | 452 | m_StaticEditorFlags: 0 |
453 | - m_IsActive: 0 | 453 | + m_IsActive: 1 |
454 | --- !u!224 &132265373 | 454 | --- !u!224 &132265373 |
455 | RectTransform: | 455 | RectTransform: |
456 | m_ObjectHideFlags: 0 | 456 | 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: 0 | 704 | + m_IsActive: 1 |
705 | --- !u!224 &310358199 | 705 | --- !u!224 &310358199 |
706 | RectTransform: | 706 | RectTransform: |
707 | m_ObjectHideFlags: 0 | 707 | m_ObjectHideFlags: 0 |
... | @@ -709,16 +709,16 @@ RectTransform: | ... | @@ -709,16 +709,16 @@ RectTransform: |
709 | m_PrefabInstance: {fileID: 0} | 709 | m_PrefabInstance: {fileID: 0} |
710 | m_PrefabAsset: {fileID: 0} | 710 | m_PrefabAsset: {fileID: 0} |
711 | m_GameObject: {fileID: 310358198} | 711 | m_GameObject: {fileID: 310358198} |
712 | - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | 712 | + m_LocalRotation: {x: 0, y: 0, z: 0.3420201, w: 0.9396927} |
713 | m_LocalPosition: {x: 0, y: 0, z: 0} | 713 | m_LocalPosition: {x: 0, y: 0, z: 0} |
714 | m_LocalScale: {x: 1, y: 1, z: 1} | 714 | m_LocalScale: {x: 1, y: 1, z: 1} |
715 | m_Children: [] | 715 | m_Children: [] |
716 | m_Father: {fileID: 1679758666} | 716 | m_Father: {fileID: 1679758666} |
717 | m_RootOrder: 18 | 717 | m_RootOrder: 18 |
718 | - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 718 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 40} |
719 | m_AnchorMin: {x: 0.5, y: 0.5} | 719 | m_AnchorMin: {x: 0.5, y: 0.5} |
720 | m_AnchorMax: {x: 0.5, y: 0.5} | 720 | m_AnchorMax: {x: 0.5, y: 0.5} |
721 | - m_AnchoredPosition: {x: 330, y: 150} | 721 | + m_AnchoredPosition: {x: 290, y: 100} |
722 | m_SizeDelta: {x: 250, y: 30} | 722 | m_SizeDelta: {x: 250, y: 30} |
723 | m_Pivot: {x: 0.5, y: 0.5} | 723 | m_Pivot: {x: 0.5, y: 0.5} |
724 | --- !u!114 &310358200 | 724 | --- !u!114 &310358200 |
... | @@ -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: 0 | 775 | + m_IsActive: 1 |
776 | --- !u!224 &395084096 | 776 | --- !u!224 &395084096 |
777 | RectTransform: | 777 | RectTransform: |
778 | m_ObjectHideFlags: 0 | 778 | m_ObjectHideFlags: 0 |
... | @@ -843,7 +843,7 @@ GameObject: | ... | @@ -843,7 +843,7 @@ GameObject: |
843 | m_Icon: {fileID: 0} | 843 | m_Icon: {fileID: 0} |
844 | m_NavMeshLayer: 0 | 844 | m_NavMeshLayer: 0 |
845 | m_StaticEditorFlags: 0 | 845 | m_StaticEditorFlags: 0 |
846 | - m_IsActive: 1 | 846 | + m_IsActive: 0 |
847 | --- !u!224 &469119555 | 847 | --- !u!224 &469119555 |
848 | RectTransform: | 848 | RectTransform: |
849 | m_ObjectHideFlags: 0 | 849 | m_ObjectHideFlags: 0 |
... | @@ -988,7 +988,7 @@ GameObject: | ... | @@ -988,7 +988,7 @@ GameObject: |
988 | m_Icon: {fileID: 0} | 988 | m_Icon: {fileID: 0} |
989 | m_NavMeshLayer: 0 | 989 | m_NavMeshLayer: 0 |
990 | m_StaticEditorFlags: 0 | 990 | m_StaticEditorFlags: 0 |
991 | - m_IsActive: 1 | 991 | + m_IsActive: 0 |
992 | --- !u!224 &618891444 | 992 | --- !u!224 &618891444 |
993 | RectTransform: | 993 | RectTransform: |
994 | m_ObjectHideFlags: 0 | 994 | m_ObjectHideFlags: 0 |
... | @@ -1066,7 +1066,7 @@ GameObject: | ... | @@ -1066,7 +1066,7 @@ GameObject: |
1066 | m_Icon: {fileID: 0} | 1066 | m_Icon: {fileID: 0} |
1067 | m_NavMeshLayer: 0 | 1067 | m_NavMeshLayer: 0 |
1068 | m_StaticEditorFlags: 0 | 1068 | m_StaticEditorFlags: 0 |
1069 | - m_IsActive: 1 | 1069 | + m_IsActive: 0 |
1070 | --- !u!114 &687225090 | 1070 | --- !u!114 &687225090 |
1071 | MonoBehaviour: | 1071 | MonoBehaviour: |
1072 | m_ObjectHideFlags: 0 | 1072 | m_ObjectHideFlags: 0 |
... | @@ -1144,7 +1144,7 @@ GameObject: | ... | @@ -1144,7 +1144,7 @@ GameObject: |
1144 | m_Icon: {fileID: 0} | 1144 | m_Icon: {fileID: 0} |
1145 | m_NavMeshLayer: 0 | 1145 | m_NavMeshLayer: 0 |
1146 | m_StaticEditorFlags: 0 | 1146 | m_StaticEditorFlags: 0 |
1147 | - m_IsActive: 1 | 1147 | + m_IsActive: 0 |
1148 | --- !u!224 &883974734 | 1148 | --- !u!224 &883974734 |
1149 | RectTransform: | 1149 | RectTransform: |
1150 | m_ObjectHideFlags: 0 | 1150 | 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: 0 | 1296 | + m_IsActive: 1 |
1297 | --- !u!224 &1089006721 | 1297 | --- !u!224 &1089006721 |
1298 | RectTransform: | 1298 | RectTransform: |
1299 | m_ObjectHideFlags: 0 | 1299 | m_ObjectHideFlags: 0 |
... | @@ -1310,7 +1310,7 @@ RectTransform: | ... | @@ -1310,7 +1310,7 @@ RectTransform: |
1310 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 1310 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
1311 | m_AnchorMin: {x: 0.5, y: 0.5} | 1311 | m_AnchorMin: {x: 0.5, y: 0.5} |
1312 | m_AnchorMax: {x: 0.5, y: 0.5} | 1312 | m_AnchorMax: {x: 0.5, y: 0.5} |
1313 | - m_AnchoredPosition: {x: 330, y: 150} | 1313 | + m_AnchoredPosition: {x: 330, y: 200} |
1314 | m_SizeDelta: {x: 250, y: 30} | 1314 | m_SizeDelta: {x: 250, y: 30} |
1315 | m_Pivot: {x: 0.5, y: 0.5} | 1315 | m_Pivot: {x: 0.5, y: 0.5} |
1316 | --- !u!114 &1089006722 | 1316 | --- !u!114 &1089006722 |
... | @@ -1526,7 +1526,7 @@ GameObject: | ... | @@ -1526,7 +1526,7 @@ GameObject: |
1526 | m_Icon: {fileID: 0} | 1526 | m_Icon: {fileID: 0} |
1527 | m_NavMeshLayer: 0 | 1527 | m_NavMeshLayer: 0 |
1528 | m_StaticEditorFlags: 0 | 1528 | m_StaticEditorFlags: 0 |
1529 | - m_IsActive: 1 | 1529 | + m_IsActive: 0 |
1530 | --- !u!224 &1313906996 | 1530 | --- !u!224 &1313906996 |
1531 | RectTransform: | 1531 | RectTransform: |
1532 | m_ObjectHideFlags: 0 | 1532 | m_ObjectHideFlags: 0 |
... | @@ -1750,6 +1750,15 @@ MonoBehaviour: | ... | @@ -1750,6 +1750,15 @@ MonoBehaviour: |
1750 | HipBalance: {fileID: 64300837} | 1750 | HipBalance: {fileID: 64300837} |
1751 | PullHipBack: {fileID: 469119556} | 1751 | PullHipBack: {fileID: 469119556} |
1752 | Great: {fileID: 1784424919} | 1752 | Great: {fileID: 1784424919} |
1753 | + count3: {fileID: 1983785836} | ||
1754 | + count2: {fileID: 132265372} | ||
1755 | + count1: {fileID: 1606945878} | ||
1756 | + HipBalance1: {fileID: 395084095} | ||
1757 | + PullHipBack2: {fileID: 109009050} | ||
1758 | + LegUp3: {fileID: 1484596775} | ||
1759 | + SpineStraight4: {fileID: 1089006720} | ||
1760 | + Great5: {fileID: 310358198} | ||
1761 | + ex_start: {fileID: 0} | ||
1753 | --- !u!4 &1461362268 | 1762 | --- !u!4 &1461362268 |
1754 | Transform: | 1763 | Transform: |
1755 | m_ObjectHideFlags: 0 | 1764 | m_ObjectHideFlags: 0 |
... | @@ -1781,7 +1790,7 @@ GameObject: | ... | @@ -1781,7 +1790,7 @@ GameObject: |
1781 | m_Icon: {fileID: 0} | 1790 | m_Icon: {fileID: 0} |
1782 | m_NavMeshLayer: 0 | 1791 | m_NavMeshLayer: 0 |
1783 | m_StaticEditorFlags: 0 | 1792 | m_StaticEditorFlags: 0 |
1784 | - m_IsActive: 0 | 1793 | + m_IsActive: 1 |
1785 | --- !u!224 &1484596776 | 1794 | --- !u!224 &1484596776 |
1786 | RectTransform: | 1795 | RectTransform: |
1787 | m_ObjectHideFlags: 0 | 1796 | m_ObjectHideFlags: 0 |
... | @@ -1852,7 +1861,7 @@ GameObject: | ... | @@ -1852,7 +1861,7 @@ GameObject: |
1852 | m_Icon: {fileID: 0} | 1861 | m_Icon: {fileID: 0} |
1853 | m_NavMeshLayer: 0 | 1862 | m_NavMeshLayer: 0 |
1854 | m_StaticEditorFlags: 0 | 1863 | m_StaticEditorFlags: 0 |
1855 | - m_IsActive: 1 | 1864 | + m_IsActive: 0 |
1856 | --- !u!224 &1493856867 | 1865 | --- !u!224 &1493856867 |
1857 | RectTransform: | 1866 | RectTransform: |
1858 | m_ObjectHideFlags: 0 | 1867 | m_ObjectHideFlags: 0 |
... | @@ -1930,7 +1939,7 @@ GameObject: | ... | @@ -1930,7 +1939,7 @@ GameObject: |
1930 | m_Icon: {fileID: 0} | 1939 | m_Icon: {fileID: 0} |
1931 | m_NavMeshLayer: 0 | 1940 | m_NavMeshLayer: 0 |
1932 | m_StaticEditorFlags: 0 | 1941 | m_StaticEditorFlags: 0 |
1933 | - m_IsActive: 1 | 1942 | + m_IsActive: 0 |
1934 | --- !u!224 &1543390837 | 1943 | --- !u!224 &1543390837 |
1935 | RectTransform: | 1944 | RectTransform: |
1936 | m_ObjectHideFlags: 0 | 1945 | m_ObjectHideFlags: 0 |
... | @@ -2008,7 +2017,7 @@ GameObject: | ... | @@ -2008,7 +2017,7 @@ GameObject: |
2008 | m_Icon: {fileID: 0} | 2017 | m_Icon: {fileID: 0} |
2009 | m_NavMeshLayer: 0 | 2018 | m_NavMeshLayer: 0 |
2010 | m_StaticEditorFlags: 0 | 2019 | m_StaticEditorFlags: 0 |
2011 | - m_IsActive: 0 | 2020 | + m_IsActive: 1 |
2012 | --- !u!224 &1606945879 | 2021 | --- !u!224 &1606945879 |
2013 | RectTransform: | 2022 | RectTransform: |
2014 | m_ObjectHideFlags: 0 | 2023 | m_ObjectHideFlags: 0 |
... | @@ -2353,7 +2362,7 @@ GameObject: | ... | @@ -2353,7 +2362,7 @@ GameObject: |
2353 | m_Icon: {fileID: 0} | 2362 | m_Icon: {fileID: 0} |
2354 | m_NavMeshLayer: 0 | 2363 | m_NavMeshLayer: 0 |
2355 | m_StaticEditorFlags: 0 | 2364 | m_StaticEditorFlags: 0 |
2356 | - m_IsActive: 0 | 2365 | + m_IsActive: 1 |
2357 | --- !u!224 &1723072948 | 2366 | --- !u!224 &1723072948 |
2358 | RectTransform: | 2367 | RectTransform: |
2359 | m_ObjectHideFlags: 0 | 2368 | m_ObjectHideFlags: 0 |
... | @@ -2608,7 +2617,7 @@ GameObject: | ... | @@ -2608,7 +2617,7 @@ GameObject: |
2608 | m_Icon: {fileID: 0} | 2617 | m_Icon: {fileID: 0} |
2609 | m_NavMeshLayer: 0 | 2618 | m_NavMeshLayer: 0 |
2610 | m_StaticEditorFlags: 0 | 2619 | m_StaticEditorFlags: 0 |
2611 | - m_IsActive: 0 | 2620 | + m_IsActive: 1 |
2612 | --- !u!224 &1983785837 | 2621 | --- !u!224 &1983785837 |
2613 | RectTransform: | 2622 | RectTransform: |
2614 | m_ObjectHideFlags: 0 | 2623 | m_ObjectHideFlags: 0 |
... | @@ -2679,7 +2688,7 @@ GameObject: | ... | @@ -2679,7 +2688,7 @@ GameObject: |
2679 | m_Icon: {fileID: 0} | 2688 | m_Icon: {fileID: 0} |
2680 | m_NavMeshLayer: 0 | 2689 | m_NavMeshLayer: 0 |
2681 | m_StaticEditorFlags: 0 | 2690 | m_StaticEditorFlags: 0 |
2682 | - m_IsActive: 1 | 2691 | + m_IsActive: 0 |
2683 | --- !u!224 &2059169296 | 2692 | --- !u!224 &2059169296 |
2684 | RectTransform: | 2693 | RectTransform: |
2685 | m_ObjectHideFlags: 0 | 2694 | m_ObjectHideFlags: 0 | ... | ... |
... | @@ -55,6 +55,14 @@ public class Move : MonoBehaviour | ... | @@ -55,6 +55,14 @@ public class Move : MonoBehaviour |
55 | string spinestraight, pullhipback, great; | 55 | string spinestraight, pullhipback, great; |
56 | 56 | ||
57 | string exercise; | 57 | string exercise; |
58 | + int squat_flag, squat_count; | ||
59 | + private float timer; | ||
60 | + | ||
61 | + public GameObject count3; | ||
62 | + public GameObject count2; | ||
63 | + public GameObject count1; | ||
64 | + public GameObject HipBalance1, PullHipBack2, LegUp3, SpineStraight4, Great5; | ||
65 | + public GameObject ex_start; | ||
58 | 66 | ||
59 | //lsy | 67 | //lsy |
60 | void Trainer_Run() | 68 | void Trainer_Run() |
... | @@ -101,6 +109,8 @@ public class Move : MonoBehaviour | ... | @@ -101,6 +109,8 @@ public class Move : MonoBehaviour |
101 | 109 | ||
102 | void Start() | 110 | void Start() |
103 | { | 111 | { |
112 | + timer = 0; | ||
113 | + | ||
104 | skeleton_Trainnner = new CharacterSkeleton(Trainnner); | 114 | skeleton_Trainnner = new CharacterSkeleton(Trainnner); |
105 | skeleton_Trainnne = new CharacterSkeleton(Trainnne); | 115 | skeleton_Trainnne = new CharacterSkeleton(Trainnne); |
106 | 116 | ||
... | @@ -113,6 +123,15 @@ public class Move : MonoBehaviour | ... | @@ -113,6 +123,15 @@ public class Move : MonoBehaviour |
113 | 123 | ||
114 | exercise = ClickExercise.selected_exercise; //ClickExercise에서 선택한 운동이 무엇인지 String으로 넘어옴. | 124 | exercise = ClickExercise.selected_exercise; //ClickExercise에서 선택한 운동이 무엇인지 String으로 넘어옴. |
115 | Debug.Log(exercise); //Squat, SideHiKick, Lunge 에 따라서 Trainer움직이고, 사용자에게 instruction주기 | 125 | Debug.Log(exercise); //Squat, SideHiKick, Lunge 에 따라서 Trainer움직이고, 사용자에게 instruction주기 |
126 | + | ||
127 | + squat_count = 0; | ||
128 | + squat_flag = 0; | ||
129 | + | ||
130 | + HipBalance1.SetActive(false); | ||
131 | + PullHipBack2.SetActive(false); | ||
132 | + LegUp3.SetActive(false); | ||
133 | + SpineStraight4.SetActive(false); | ||
134 | + Great5.SetActive(false); | ||
116 | } | 135 | } |
117 | 136 | ||
118 | private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>() | 137 | private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>() |
... | @@ -149,6 +168,54 @@ public class Move : MonoBehaviour | ... | @@ -149,6 +168,54 @@ public class Move : MonoBehaviour |
149 | 168 | ||
150 | void Update() | 169 | void Update() |
151 | { | 170 | { |
171 | + | ||
172 | + timer += Time.deltaTime; | ||
173 | + Debug.Log("Timer: " + timer); | ||
174 | + if (timer < 1) | ||
175 | + { | ||
176 | + count3.SetActive(true); | ||
177 | + count2.SetActive(false); | ||
178 | + count1.SetActive(false); | ||
179 | + ex_start.SetActive(true); | ||
180 | + | ||
181 | + HipBalance1.SetActive(false); | ||
182 | + PullHipBack2.SetActive(false); | ||
183 | + LegUp3.SetActive(false); | ||
184 | + SpineStraight4.SetActive(false); | ||
185 | + Great5.SetActive(false); | ||
186 | + } | ||
187 | + else if (timer >= 1 && timer < 2) { | ||
188 | + count3.SetActive(false); | ||
189 | + count2.SetActive(true); | ||
190 | + count1.SetActive(false); | ||
191 | + ex_start.SetActive(true); | ||
192 | + | ||
193 | + HipBalance1.SetActive(false); | ||
194 | + PullHipBack2.SetActive(false); | ||
195 | + LegUp3.SetActive(false); | ||
196 | + SpineStraight4.SetActive(false); | ||
197 | + Great5.SetActive(false); | ||
198 | + } | ||
199 | + else if (timer >= 2 && timer < 3) | ||
200 | + { | ||
201 | + count3.SetActive(false); | ||
202 | + count2.SetActive(false); | ||
203 | + count1.SetActive(true); | ||
204 | + ex_start.SetActive(true); | ||
205 | + | ||
206 | + HipBalance1.SetActive(false); | ||
207 | + PullHipBack2.SetActive(false); | ||
208 | + LegUp3.SetActive(false); | ||
209 | + SpineStraight4.SetActive(false); | ||
210 | + Great5.SetActive(false); | ||
211 | + } | ||
212 | + else | ||
213 | + { | ||
214 | + count3.SetActive(false); | ||
215 | + count2.SetActive(false); | ||
216 | + count1.SetActive(false); | ||
217 | + ex_start.SetActive(false); | ||
218 | + | ||
152 | //lsy | 219 | //lsy |
153 | Trainer_Run(); | 220 | Trainer_Run(); |
154 | //lsy end | 221 | //lsy end |
... | @@ -237,6 +304,8 @@ public class Move : MonoBehaviour | ... | @@ -237,6 +304,8 @@ public class Move : MonoBehaviour |
237 | } | 304 | } |
238 | } | 305 | } |
239 | 306 | ||
307 | + } | ||
308 | + | ||
240 | private GameObject CreateBodyObject(ulong id) | 309 | private GameObject CreateBodyObject(ulong id) |
241 | { | 310 | { |
242 | 311 | ||
... | @@ -277,74 +346,102 @@ public class Move : MonoBehaviour | ... | @@ -277,74 +346,102 @@ public class Move : MonoBehaviour |
277 | /////////////////////////// | 346 | /////////////////////////// |
278 | Angles MyAngles = new Angles(); | 347 | Angles MyAngles = new Angles(); |
279 | byte[] ReadAngles = MyAngles.GetVector(body); | 348 | byte[] ReadAngles = MyAngles.GetVector(body); |
280 | - // ReadAngles[0].ToString(); | ||
281 | - //Debug.Log("HipLeft " + ReadAngles[1].ToString()); | ||
282 | - //Debug.Log("HipRight " + ReadAngles[2].ToString()); | ||
283 | - //Debug.Log("KneeLeft " + ReadAngles[3].ToString()); | ||
284 | - //Debug.Log("KneeRight " + ReadAngles[4].ToString()); | ||
285 | - | ||
286 | 349 | ||
350 | + if (exercise == "Squat") | ||
351 | + { | ||
287 | if (ReadAngles[1] - ReadAngles[2] <= 5) | 352 | if (ReadAngles[1] - ReadAngles[2] <= 5) |
288 | { | 353 | { |
289 | hipbal = ""; | 354 | hipbal = ""; |
290 | //hipbal = "양쪽 균형이 잡혀있습니다."; | 355 | //hipbal = "양쪽 균형이 잡혀있습니다."; |
356 | + HipBalance1.SetActive(false); | ||
291 | } | 357 | } |
292 | else | 358 | else |
293 | { | 359 | { |
294 | hipbal = "양쪽 힘이 동일하지 않습니다. \n균형을 잡으세요!"; | 360 | hipbal = "양쪽 힘이 동일하지 않습니다. \n균형을 잡으세요!"; |
361 | + HipBalance1.SetActive(true); | ||
295 | } | 362 | } |
296 | 363 | ||
297 | - if (ReadAngles[5] > 90) | 364 | + if (ReadAngles[5] > 95 || ReadAngles[6] > 95) |
298 | { | 365 | { |
299 | - //leftkneewarning = "왼쪽 무릎이 발끝을 넘어갔습니다."; | ||
300 | pullhipback = "엉덩이를 뒤로 더 빼세요!"; | 366 | pullhipback = "엉덩이를 뒤로 더 빼세요!"; |
367 | + PullHipBack2.SetActive(true); | ||
301 | } | 368 | } |
302 | else | 369 | else |
303 | { | 370 | { |
304 | - leftkneewarning = ""; | 371 | + PullHipBack2.SetActive(false); |
305 | } | 372 | } |
306 | - if (ReadAngles[6] > 90) | 373 | + |
374 | + if (ReadAngles[3] < 95 && ReadAngles[4] < 95) | ||
307 | { | 375 | { |
308 | - //rightkneewarning = "오른쪽 무릎이 발끝을 넘어갔습니다."; | 376 | + great = "GREAT!"; |
309 | - pullhipback = "엉덩이를 뒤로 더 빼세요!"; | 377 | + Debug.Log(ReadAngles[3]); |
378 | + Great5.SetActive(true); | ||
310 | } | 379 | } |
311 | else | 380 | else |
312 | { | 381 | { |
313 | - rightkneewarning = ""; | 382 | + great = ""; |
383 | + Great5.SetActive(false); | ||
384 | + } | ||
385 | + | ||
386 | + | ||
314 | } | 387 | } |
388 | + else if (exercise == "SideHiKick") | ||
389 | + { | ||
315 | 390 | ||
316 | - if (ReadAngles[7] < 45) | 391 | + if (ReadAngles[7] < 40 || ReadAngles[8] < 40) |
317 | { | 392 | { |
318 | - leftsidehighkick = "왼쪽 다리를 좀 더 높이 들어올리세요"; | 393 | + Debug.Log(ReadAngles[7] + " , " + ReadAngles[8]); //7,8 동일함 |
394 | + LegUp3.SetActive(true); //다리를 더 높이 들어올리세요 | ||
395 | + Great5.SetActive(false); | ||
396 | + } | ||
397 | + else if (ReadAngles[7] <= 5) | ||
398 | + { | ||
399 | + LegUp3.SetActive(false); | ||
319 | } | 400 | } |
320 | else | 401 | else |
321 | { | 402 | { |
322 | - leftsidehighkick = ""; | 403 | + LegUp3.SetActive(false); |
323 | } | 404 | } |
324 | 405 | ||
325 | - if (ReadAngles[8] < 45) | 406 | + if (ReadAngles[7] >= 40) |
326 | { | 407 | { |
327 | - rightsidehighkick = "오른쪽 다리를 좀 더 높이 들어올리세요"; | 408 | + Great5.SetActive(true); //Great |
328 | } | 409 | } |
329 | - else | 410 | + else if (ReadAngles[8] >= 40) |
330 | { | 411 | { |
331 | - rightsidehighkick = ""; | 412 | + Great5.SetActive(true); //Great |
332 | - } | ||
333 | 413 | ||
334 | - if (ReadAngles[0] < 170 || ReadAngles[0] > 190) | 414 | + } |
415 | + else | ||
335 | { | 416 | { |
336 | - spinestraight = "허리를 곧게 펴세요!"; | 417 | + Great5.SetActive(false); |
337 | } | 418 | } |
338 | - else { | ||
339 | - spinestraight = ""; | ||
340 | } | 419 | } |
420 | + else if (exercise == "Lunge") | ||
421 | + { | ||
341 | 422 | ||
342 | - if (ReadAngles[3] < 100 || ReadAngles[4] < 100) | 423 | + if (ReadAngles[3] < 95 || ReadAngles[4] < 95) |
343 | { | 424 | { |
344 | great = "GREAT!"; | 425 | great = "GREAT!"; |
426 | + Great5.SetActive(true); | ||
345 | } | 427 | } |
346 | - else { | 428 | + else |
429 | + { | ||
347 | great = ""; | 430 | great = ""; |
431 | + Great5.SetActive(false); | ||
432 | + } | ||
433 | + } | ||
434 | + | ||
435 | + //공통된 사항 | ||
436 | + if (ReadAngles[0] < 170 || ReadAngles[0] > 190) | ||
437 | + { | ||
438 | + spinestraight = "허리를 곧게 펴세요!"; | ||
439 | + SpineStraight4.SetActive(true); | ||
440 | + } | ||
441 | + else | ||
442 | + { | ||
443 | + spinestraight = ""; | ||
444 | + SpineStraight4.SetActive(false); | ||
348 | } | 445 | } |
349 | 446 | ||
350 | IfSpineIsStraight.text =spinestraight; | 447 | IfSpineIsStraight.text =spinestraight; |
... | @@ -466,13 +563,18 @@ public class Move : MonoBehaviour | ... | @@ -466,13 +563,18 @@ public class Move : MonoBehaviour |
466 | 563 | ||
467 | double AngleLeftHip = AngleBetweenTwoVectors(SpineBase - SpineShoulder, HipLeft - KneeLeft); //스쿼트, 런지 | 564 | double AngleLeftHip = AngleBetweenTwoVectors(SpineBase - SpineShoulder, HipLeft - KneeLeft); //스쿼트, 런지 |
468 | double AngleRightHip = AngleBetweenTwoVectors(SpineBase - SpineShoulder, HipRight - KneeRight); //스쿼트, 런지 | 565 | double AngleRightHip = AngleBetweenTwoVectors(SpineBase - SpineShoulder, HipRight - KneeRight); //스쿼트, 런지 |
469 | - double AngleLeftKnee = AngleBetweenTwoVectors(KneeLeft - HipLeft, KneeLeft - AnkleLeft); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 | 566 | + //double AngleLeftKnee = AngleBetweenTwoVectors(KneeLeft - HipLeft, KneeLeft - AnkleLeft); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 |
470 | - double AngleRightKnee = AngleBetweenTwoVectors(KneeRight - HipRight, KneeRight - AnkleRight); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 | 567 | + double AngleLeftKnee = AngleBetweenTwoVectors(HipLeft - KneeLeft, AnkleLeft - KneeLeft); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 |
568 | + //double AngleRightKnee = AngleBetweenTwoVectors(KneeRight - HipRight, KneeRight - AnkleRight); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 | ||
569 | + double AngleRightKnee = AngleBetweenTwoVectors(HipRight - KneeRight, AnkleRight - KneeRight); //스쿼트, 런지, 사이드하이킥 - Joint 3개로도 가능 | ||
471 | 570 | ||
472 | double KneeToeLeft = AngleBetweenTwoVectors(AnkleLeft - FootLeft, KneeLeft - FootLeft); //스쿼트 - Joint 3개로도 가능 | 571 | double KneeToeLeft = AngleBetweenTwoVectors(AnkleLeft - FootLeft, KneeLeft - FootLeft); //스쿼트 - Joint 3개로도 가능 |
473 | double KneeToeRight = AngleBetweenTwoVectors(AnkleRight - FootRight, KneeRight - FootRight); //스쿼트 - Joint 3개로도 가능 | 572 | double KneeToeRight = AngleBetweenTwoVectors(AnkleRight - FootRight, KneeRight - FootRight); //스쿼트 - Joint 3개로도 가능 |
474 | - double LeftLegUp = AngleBetweenTwoVectors(SpineMid - SpineShoulder, KneeLeft - HipLeft); //사이드 하이킥 | 573 | + //double LeftLegUp = AngleBetweenTwoVectors(SpineMid - SpineShoulder, KneeLeft - HipLeft); //사이드 하이킥 |
475 | - double RightLegUp = AngleBetweenTwoVectors(SpineMid - SpineShoulder, KneeRight - HipRight); //사이드 하이킥 | 574 | + //double RightLegUp = AngleBetweenTwoVectors(SpineMid - SpineShoulder, KneeRight - HipRight); //사이드 하이킥 |
575 | + double LeftLegUp = AngleBetweenTwoVectors(KneeRight - HipRight, KneeLeft - HipLeft); //사이드 하이킥 | ||
576 | + double RightLegUp = AngleBetweenTwoVectors(KneeLeft - HipLeft, KneeRight - HipRight); //사이드 하이킥 | ||
577 | + //LeftLegUp이랑 RightLegUp이랑 각도 동일 | ||
476 | 578 | ||
477 | 579 | ||
478 | byte[] Angles = { Convert.ToByte(StraightSpine), | 580 | byte[] Angles = { Convert.ToByte(StraightSpine), | ... | ... |
-
Please register or login to post a comment