Showing
3 changed files
with
211 additions
and
54 deletions
| ... | @@ -222,7 +222,7 @@ RectTransform: | ... | @@ -222,7 +222,7 @@ RectTransform: |
| 222 | m_LocalScale: {x: 2, y: 2, z: 2} | 222 | m_LocalScale: {x: 2, y: 2, z: 2} |
| 223 | m_Children: [] | 223 | m_Children: [] |
| 224 | m_Father: {fileID: 1679758666} | 224 | m_Father: {fileID: 1679758666} |
| 225 | - m_RootOrder: 29 | 225 | + m_RootOrder: 26 |
| 226 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 226 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| 227 | m_AnchorMin: {x: 0.5, y: 0.5} | 227 | m_AnchorMin: {x: 0.5, y: 0.5} |
| 228 | m_AnchorMax: {x: 0.5, y: 0.5} | 228 | m_AnchorMax: {x: 0.5, y: 0.5} |
| ... | @@ -1283,6 +1283,77 @@ RectTransform: | ... | @@ -1283,6 +1283,77 @@ RectTransform: |
| 1283 | m_AnchoredPosition: {x: 0, y: 0} | 1283 | m_AnchoredPosition: {x: 0, y: 0} |
| 1284 | m_SizeDelta: {x: 160, y: 30} | 1284 | m_SizeDelta: {x: 160, y: 30} |
| 1285 | m_Pivot: {x: 0.5, y: 0.5} | 1285 | m_Pivot: {x: 0.5, y: 0.5} |
| 1286 | +--- !u!1 &779933557 | ||
| 1287 | +GameObject: | ||
| 1288 | + m_ObjectHideFlags: 0 | ||
| 1289 | + m_CorrespondingSourceObject: {fileID: 0} | ||
| 1290 | + m_PrefabInstance: {fileID: 0} | ||
| 1291 | + m_PrefabAsset: {fileID: 0} | ||
| 1292 | + serializedVersion: 6 | ||
| 1293 | + m_Component: | ||
| 1294 | + - component: {fileID: 779933558} | ||
| 1295 | + - component: {fileID: 779933560} | ||
| 1296 | + - component: {fileID: 779933559} | ||
| 1297 | + m_Layer: 5 | ||
| 1298 | + m_Name: Right_Start | ||
| 1299 | + m_TagString: Untagged | ||
| 1300 | + m_Icon: {fileID: 0} | ||
| 1301 | + m_NavMeshLayer: 0 | ||
| 1302 | + m_StaticEditorFlags: 0 | ||
| 1303 | + m_IsActive: 0 | ||
| 1304 | +--- !u!224 &779933558 | ||
| 1305 | +RectTransform: | ||
| 1306 | + m_ObjectHideFlags: 0 | ||
| 1307 | + m_CorrespondingSourceObject: {fileID: 0} | ||
| 1308 | + m_PrefabInstance: {fileID: 0} | ||
| 1309 | + m_PrefabAsset: {fileID: 0} | ||
| 1310 | + m_GameObject: {fileID: 779933557} | ||
| 1311 | + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} | ||
| 1312 | + m_LocalPosition: {x: 0, y: 0, z: 0} | ||
| 1313 | + m_LocalScale: {x: 1, y: 1, z: 1} | ||
| 1314 | + m_Children: [] | ||
| 1315 | + m_Father: {fileID: 1679758666} | ||
| 1316 | + m_RootOrder: 30 | ||
| 1317 | + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | ||
| 1318 | + m_AnchorMin: {x: 0.5, y: 0.5} | ||
| 1319 | + m_AnchorMax: {x: 0.5, y: 0.5} | ||
| 1320 | + m_AnchoredPosition: {x: 0, y: 250} | ||
| 1321 | + m_SizeDelta: {x: 320, y: 130} | ||
| 1322 | + m_Pivot: {x: 0.5, y: 0.5} | ||
| 1323 | +--- !u!114 &779933559 | ||
| 1324 | +MonoBehaviour: | ||
| 1325 | + m_ObjectHideFlags: 0 | ||
| 1326 | + m_CorrespondingSourceObject: {fileID: 0} | ||
| 1327 | + m_PrefabInstance: {fileID: 0} | ||
| 1328 | + m_PrefabAsset: {fileID: 0} | ||
| 1329 | + m_GameObject: {fileID: 779933557} | ||
| 1330 | + m_Enabled: 1 | ||
| 1331 | + m_EditorHideFlags: 0 | ||
| 1332 | + m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3} | ||
| 1333 | + m_Name: | ||
| 1334 | + m_EditorClassIdentifier: | ||
| 1335 | + m_Material: {fileID: 0} | ||
| 1336 | + m_Color: {r: 1, g: 1, b: 1, a: 1} | ||
| 1337 | + m_RaycastTarget: 1 | ||
| 1338 | + m_Maskable: 1 | ||
| 1339 | + m_OnCullStateChanged: | ||
| 1340 | + m_PersistentCalls: | ||
| 1341 | + m_Calls: [] | ||
| 1342 | + m_Texture: {fileID: 2800000, guid: 8eaaf7c57a8e30649840113180ae24e0, type: 3} | ||
| 1343 | + m_UVRect: | ||
| 1344 | + serializedVersion: 2 | ||
| 1345 | + x: 0 | ||
| 1346 | + y: 0 | ||
| 1347 | + width: 1 | ||
| 1348 | + height: 1 | ||
| 1349 | +--- !u!222 &779933560 | ||
| 1350 | +CanvasRenderer: | ||
| 1351 | + m_ObjectHideFlags: 0 | ||
| 1352 | + m_CorrespondingSourceObject: {fileID: 0} | ||
| 1353 | + m_PrefabInstance: {fileID: 0} | ||
| 1354 | + m_PrefabAsset: {fileID: 0} | ||
| 1355 | + m_GameObject: {fileID: 779933557} | ||
| 1356 | + m_CullTransparentMesh: 0 | ||
| 1286 | --- !u!1 &883974733 | 1357 | --- !u!1 &883974733 |
| 1287 | GameObject: | 1358 | GameObject: |
| 1288 | m_ObjectHideFlags: 0 | 1359 | m_ObjectHideFlags: 0 |
| ... | @@ -2070,6 +2141,7 @@ MonoBehaviour: | ... | @@ -2070,6 +2141,7 @@ MonoBehaviour: |
| 2070 | SideHighKick_Instruction: {fileID: 1616699126} | 2141 | SideHighKick_Instruction: {fileID: 1616699126} |
| 2071 | Lunge_Left_Instruction: {fileID: 1914474766} | 2142 | Lunge_Left_Instruction: {fileID: 1914474766} |
| 2072 | Lunge_Right_Instruction: {fileID: 1540314533} | 2143 | Lunge_Right_Instruction: {fileID: 1540314533} |
| 2144 | + Right_Start: {fileID: 0} | ||
| 2073 | --- !u!4 &1461362268 | 2145 | --- !u!4 &1461362268 |
| 2074 | Transform: | 2146 | Transform: |
| 2075 | m_ObjectHideFlags: 0 | 2147 | m_ObjectHideFlags: 0 |
| ... | @@ -2263,7 +2335,7 @@ RectTransform: | ... | @@ -2263,7 +2335,7 @@ RectTransform: |
| 2263 | m_LocalScale: {x: 8, y: 3, z: 1} | 2335 | m_LocalScale: {x: 8, y: 3, z: 1} |
| 2264 | m_Children: [] | 2336 | m_Children: [] |
| 2265 | m_Father: {fileID: 1679758666} | 2337 | m_Father: {fileID: 1679758666} |
| 2266 | - m_RootOrder: 28 | 2338 | + m_RootOrder: 29 |
| 2267 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 2339 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| 2268 | m_AnchorMin: {x: 0.5, y: 0.5} | 2340 | m_AnchorMin: {x: 0.5, y: 0.5} |
| 2269 | m_AnchorMax: {x: 0.5, y: 0.5} | 2341 | m_AnchorMax: {x: 0.5, y: 0.5} |
| ... | @@ -2483,12 +2555,12 @@ RectTransform: | ... | @@ -2483,12 +2555,12 @@ RectTransform: |
| 2483 | m_LocalScale: {x: 8, y: 3, z: 1} | 2555 | m_LocalScale: {x: 8, y: 3, z: 1} |
| 2484 | m_Children: [] | 2556 | m_Children: [] |
| 2485 | m_Father: {fileID: 1679758666} | 2557 | m_Father: {fileID: 1679758666} |
| 2486 | - m_RootOrder: 26 | 2558 | + m_RootOrder: 27 |
| 2487 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 2559 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| 2488 | m_AnchorMin: {x: 0.5, y: 0.5} | 2560 | m_AnchorMin: {x: 0.5, y: 0.5} |
| 2489 | m_AnchorMax: {x: 0.5, y: 0.5} | 2561 | m_AnchorMax: {x: 0.5, y: 0.5} |
| 2490 | m_AnchoredPosition: {x: 0, y: 0} | 2562 | m_AnchoredPosition: {x: 0, y: 0} |
| 2491 | - m_SizeDelta: {x: 100, y: 100} | 2563 | + m_SizeDelta: {x: 100, y: 120} |
| 2492 | m_Pivot: {x: 0.5, y: 0.5} | 2564 | m_Pivot: {x: 0.5, y: 0.5} |
| 2493 | --- !u!114 &1616699128 | 2565 | --- !u!114 &1616699128 |
| 2494 | MonoBehaviour: | 2566 | MonoBehaviour: |
| ... | @@ -2733,10 +2805,11 @@ RectTransform: | ... | @@ -2733,10 +2805,11 @@ RectTransform: |
| 2733 | - {fileID: 938472433} | 2805 | - {fileID: 938472433} |
| 2734 | - {fileID: 433964838} | 2806 | - {fileID: 433964838} |
| 2735 | - {fileID: 1019081449} | 2807 | - {fileID: 1019081449} |
| 2808 | + - {fileID: 22123170} | ||
| 2736 | - {fileID: 1616699127} | 2809 | - {fileID: 1616699127} |
| 2737 | - {fileID: 1914474767} | 2810 | - {fileID: 1914474767} |
| 2738 | - {fileID: 1540314534} | 2811 | - {fileID: 1540314534} |
| 2739 | - - {fileID: 22123170} | 2812 | + - {fileID: 779933558} |
| 2740 | m_Father: {fileID: 0} | 2813 | m_Father: {fileID: 0} |
| 2741 | m_RootOrder: 4 | 2814 | m_RootOrder: 4 |
| 2742 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 2815 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| ... | @@ -3090,7 +3163,7 @@ RectTransform: | ... | @@ -3090,7 +3163,7 @@ RectTransform: |
| 3090 | m_LocalScale: {x: 8, y: 3, z: 1} | 3163 | m_LocalScale: {x: 8, y: 3, z: 1} |
| 3091 | m_Children: [] | 3164 | m_Children: [] |
| 3092 | m_Father: {fileID: 1679758666} | 3165 | m_Father: {fileID: 1679758666} |
| 3093 | - m_RootOrder: 27 | 3166 | + m_RootOrder: 28 |
| 3094 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} | 3167 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
| 3095 | m_AnchorMin: {x: 0.5, y: 0.5} | 3168 | m_AnchorMin: {x: 0.5, y: 0.5} |
| 3096 | m_AnchorMax: {x: 0.5, y: 0.5} | 3169 | m_AnchorMax: {x: 0.5, y: 0.5} | ... | ... |
| ... | @@ -65,15 +65,20 @@ public class Move : MonoBehaviour | ... | @@ -65,15 +65,20 @@ public class Move : MonoBehaviour |
| 65 | string exercise; | 65 | string exercise; |
| 66 | int workout_flag, workout_count, workout_flag2; | 66 | int workout_flag, workout_count, workout_flag2; |
| 67 | bool workout; | 67 | bool workout; |
| 68 | + | ||
| 69 | + int sidehk_flag, lunge_flag_l, lunge_flag_r; | ||
| 70 | + | ||
| 68 | private float timer; | 71 | private float timer; |
| 72 | + private float flag_timer; | ||
| 73 | + int flag; | ||
| 69 | 74 | ||
| 70 | public GameObject count3; | 75 | public GameObject count3; |
| 71 | public GameObject count2; | 76 | public GameObject count2; |
| 72 | public GameObject count1; | 77 | public GameObject count1; |
| 73 | public GameObject HipBalance1, PullHipBack2, LegUp3, SpineStraight4, Great5, KneeDown6; | 78 | public GameObject HipBalance1, PullHipBack2, LegUp3, SpineStraight4, Great5, KneeDown6; |
| 74 | public GameObject ex_start; | 79 | public GameObject ex_start; |
| 75 | - public GameObject Squat_Instruction, SideHighKick_Instruction, Lunge_Left_Instruction, Lunge_Right_Instruction; | 80 | + public GameObject Squat_Instruction, SideHighKick_Instruction, Lunge_Left_Instruction, Lunge_Right_Instruction; |
| 76 | - | 81 | + public GameObject Right_Start; |
| 77 | 82 | ||
| 78 | //lsy | 83 | //lsy |
| 79 | void Trainer_Run() | 84 | void Trainer_Run() |
| ... | @@ -116,6 +121,8 @@ public class Move : MonoBehaviour | ... | @@ -116,6 +121,8 @@ public class Move : MonoBehaviour |
| 116 | { | 121 | { |
| 117 | if (trainer_timer > 3) | 122 | if (trainer_timer > 3) |
| 118 | { | 123 | { |
| 124 | + Right_Start.SetActive(false); | ||
| 125 | + | ||
| 119 | trainer_count = 0; | 126 | trainer_count = 0; |
| 120 | lines = lines_right; | 127 | lines = lines_right; |
| 121 | trainer_other_side = true; | 128 | trainer_other_side = true; |
| ... | @@ -123,6 +130,8 @@ public class Move : MonoBehaviour | ... | @@ -123,6 +130,8 @@ public class Move : MonoBehaviour |
| 123 | } | 130 | } |
| 124 | else | 131 | else |
| 125 | { | 132 | { |
| 133 | + Right_Start.SetActive(true); | ||
| 134 | + | ||
| 126 | trainer_timer += Time.deltaTime; | 135 | trainer_timer += Time.deltaTime; |
| 127 | return; | 136 | return; |
| 128 | } | 137 | } |
| ... | @@ -138,6 +147,8 @@ public class Move : MonoBehaviour | ... | @@ -138,6 +147,8 @@ public class Move : MonoBehaviour |
| 138 | { | 147 | { |
| 139 | if (trainer_timer > 3) | 148 | if (trainer_timer > 3) |
| 140 | { | 149 | { |
| 150 | + Lunge_Right_Instruction.SetActive(false); | ||
| 151 | + | ||
| 141 | trainer_speed = 8; | 152 | trainer_speed = 8; |
| 142 | trainer_count = 0; | 153 | trainer_count = 0; |
| 143 | lines = lines_right; | 154 | lines = lines_right; |
| ... | @@ -146,6 +157,8 @@ public class Move : MonoBehaviour | ... | @@ -146,6 +157,8 @@ public class Move : MonoBehaviour |
| 146 | } | 157 | } |
| 147 | else | 158 | else |
| 148 | { | 159 | { |
| 160 | + Lunge_Right_Instruction.SetActive(true); | ||
| 161 | + | ||
| 149 | trainer_timer += Time.deltaTime; | 162 | trainer_timer += Time.deltaTime; |
| 150 | return; | 163 | return; |
| 151 | } | 164 | } |
| ... | @@ -212,6 +225,7 @@ public class Move : MonoBehaviour | ... | @@ -212,6 +225,7 @@ public class Move : MonoBehaviour |
| 212 | 225 | ||
| 213 | workout_count++; | 226 | workout_count++; |
| 214 | workout = false; | 227 | workout = false; |
| 228 | + Debug.Log("트레이니: " + workout_count); | ||
| 215 | 229 | ||
| 216 | } | 230 | } |
| 217 | 231 | ||
| ... | @@ -228,7 +242,7 @@ public class Move : MonoBehaviour | ... | @@ -228,7 +242,7 @@ public class Move : MonoBehaviour |
| 228 | //lsy end | 242 | //lsy end |
| 229 | 243 | ||
| 230 | exercise = ClickExercise.selected_exercise; //ClickExercise에서 선택한 운동이 무엇인지 String으로 넘어옴. | 244 | exercise = ClickExercise.selected_exercise; //ClickExercise에서 선택한 운동이 무엇인지 String으로 넘어옴. |
| 231 | - exercise = "SideHiKick"; | 245 | + exercise = "Squat"; |
| 232 | Debug.Log(exercise); //Squat, SideHiKick, Lunge 에 따라서 Trainer움직이고, 사용자에게 instruction주기 | 246 | Debug.Log(exercise); //Squat, SideHiKick, Lunge 에 따라서 Trainer움직이고, 사용자에게 instruction주기 |
| 233 | 247 | ||
| 234 | if (exercise == "Squat") | 248 | if (exercise == "Squat") |
| ... | @@ -260,6 +274,12 @@ public class Move : MonoBehaviour | ... | @@ -260,6 +274,12 @@ public class Move : MonoBehaviour |
| 260 | workout_flag2 = 0; | 274 | workout_flag2 = 0; |
| 261 | workout = false; | 275 | workout = false; |
| 262 | 276 | ||
| 277 | + sidehk_flag = 0; | ||
| 278 | + lunge_flag_l = 0; | ||
| 279 | + lunge_flag_r = 0; | ||
| 280 | + flag = 0; | ||
| 281 | + flag_timer = 0; | ||
| 282 | + | ||
| 263 | if (exercise == "Squat") | 283 | if (exercise == "Squat") |
| 264 | { | 284 | { |
| 265 | Squat_Instruction.SetActive(true); | 285 | Squat_Instruction.SetActive(true); |
| ... | @@ -550,7 +570,7 @@ public class Move : MonoBehaviour | ... | @@ -550,7 +570,7 @@ public class Move : MonoBehaviour |
| 550 | if (ReadAngles[3] < 95 && ReadAngles[4] < 95) | 570 | if (ReadAngles[3] < 95 && ReadAngles[4] < 95) |
| 551 | { | 571 | { |
| 552 | great = "GREAT!"; | 572 | great = "GREAT!"; |
| 553 | - Debug.Log(ReadAngles[3]); | 573 | + //Debug.Log(ReadAngles[3]); |
| 554 | Great5.SetActive(true); | 574 | Great5.SetActive(true); |
| 555 | } | 575 | } |
| 556 | else | 576 | else |
| ... | @@ -575,27 +595,23 @@ public class Move : MonoBehaviour | ... | @@ -575,27 +595,23 @@ public class Move : MonoBehaviour |
| 575 | } | 595 | } |
| 576 | else if (exercise == "SideHiKick") | 596 | else if (exercise == "SideHiKick") |
| 577 | { | 597 | { |
| 578 | - | 598 | + if ((ReadAngles[7] < 45) && (ReadAngles[7] > 10) |
| 579 | - if (ReadAngles[7] < 40 || ReadAngles[8] < 40) | 599 | + && (sidehk_flag < ReadAngles[7])) |
| 580 | { | 600 | { |
| 581 | - Debug.Log(ReadAngles[7] + " , " + ReadAngles[8]); //7,8 동일함 | ||
| 582 | LegUp3.SetActive(true); //다리를 더 높이 들어올리세요 | 601 | LegUp3.SetActive(true); //다리를 더 높이 들어올리세요 |
| 583 | Great5.SetActive(false); | 602 | Great5.SetActive(false); |
| 584 | - } | 603 | + |
| 585 | - else if (ReadAngles[7] <= 5) | ||
| 586 | - { | ||
| 587 | - LegUp3.SetActive(false); | ||
| 588 | } | 604 | } |
| 589 | else | 605 | else |
| 590 | { | 606 | { |
| 591 | LegUp3.SetActive(false); | 607 | LegUp3.SetActive(false); |
| 592 | - } | 608 | + Great5.SetActive(false); |
| 593 | 609 | ||
| 594 | - if (ReadAngles[7] >= 40) | 610 | + //이전각도 |
| 595 | - { | 611 | + sidehk_flag = ReadAngles[7]; |
| 596 | - Great5.SetActive(true); //Great | ||
| 597 | } | 612 | } |
| 598 | - else if (ReadAngles[8] >= 40) | 613 | + |
| 614 | + if (ReadAngles[7] >= 45) | ||
| 599 | { | 615 | { |
| 600 | Great5.SetActive(true); //Great | 616 | Great5.SetActive(true); //Great |
| 601 | } | 617 | } |
| ... | @@ -605,7 +621,7 @@ public class Move : MonoBehaviour | ... | @@ -605,7 +621,7 @@ public class Move : MonoBehaviour |
| 605 | } | 621 | } |
| 606 | 622 | ||
| 607 | ////////운동 횟수 카운트//////////////////// | 623 | ////////운동 횟수 카운트//////////////////// |
| 608 | - if (ReadAngles[7] > 40 && workout && workout_flag <= 40) | 624 | + if (ReadAngles[7] > 45 && workout && workout_flag <= 45) |
| 609 | { | 625 | { |
| 610 | Trainee_Count(); | 626 | Trainee_Count(); |
| 611 | } | 627 | } |
| ... | @@ -614,44 +630,112 @@ public class Move : MonoBehaviour | ... | @@ -614,44 +630,112 @@ public class Move : MonoBehaviour |
| 614 | workout_flag = ReadAngles[7]; | 630 | workout_flag = ReadAngles[7]; |
| 615 | workout = true; | 631 | workout = true; |
| 616 | } | 632 | } |
| 633 | + | ||
| 634 | + | ||
| 635 | + | ||
| 617 | } | 636 | } |
| 618 | else if (exercise == "Lunge") | 637 | else if (exercise == "Lunge") |
| 619 | { | 638 | { |
| 620 | - | 639 | + if (workout_count < 10) |
| 621 | - if (ReadAngles[3] < 95 || ReadAngles[4] < 95) | ||
| 622 | - { | ||
| 623 | - great = "GREAT!"; | ||
| 624 | - Great5.SetActive(true); | ||
| 625 | - KneeDown6.SetActive(false); | ||
| 626 | - } | ||
| 627 | - else | ||
| 628 | { | 640 | { |
| 629 | - great = ""; | 641 | + if (flag == 0) |
| 630 | - Great5.SetActive(false); | 642 | + { |
| 631 | - KneeDown6.SetActive(true); | 643 | + if (lunge_flag_l < 120 && ReadAngles[3] >= 91 && lunge_flag_l > ReadAngles[3]) |
| 632 | - } | 644 | + { |
| 645 | + great = ""; | ||
| 646 | + //Great5.SetActive(false); | ||
| 647 | + KneeDown6.SetActive(true); //무릎을 더 굽혀주세요. | ||
| 648 | + flag = 1; | ||
| 649 | + | ||
| 650 | + } | ||
| 651 | + else if (ReadAngles[3] < 91) | ||
| 652 | + { | ||
| 653 | + great = "GREAT!"; | ||
| 654 | + Great5.SetActive(true); | ||
| 655 | + //KneeDown6.SetActive(false); | ||
| 656 | + | ||
| 657 | + flag = 1; | ||
| 658 | + } | ||
| 659 | + } | ||
| 660 | + else { | ||
| 661 | + | ||
| 662 | + flag_timer += Time.deltaTime; | ||
| 663 | + //Debug.Log(flag_timer); | ||
| 664 | + if (flag_timer > 50) { | ||
| 665 | + flag = 0; | ||
| 666 | + flag_timer = 0; | ||
| 667 | + Debug.Log("5초넘음"); | ||
| 668 | + | ||
| 669 | + Great5.SetActive(false); | ||
| 670 | + KneeDown6.SetActive(false); | ||
| 671 | + } | ||
| 672 | + } | ||
| 673 | + | ||
| 633 | 674 | ||
| 634 | - //////////////운동 횟수 카운트////////////////// | 675 | + //////////////운동 횟수 카운트////////////////// |
| 635 | - //왼쪽 | 676 | + //왼쪽 |
| 636 | - if (ReadAngles[3] < 95 && workout && workout_flag >= 95) | 677 | + if (ReadAngles[3] < 95 && workout && workout_flag >= 95) |
| 637 | - { | 678 | + { |
| 638 | - Trainee_Count(); | 679 | + Trainee_Count(); |
| 639 | - } | 680 | + } |
| 640 | - else | 681 | + else |
| 641 | - { | 682 | + { |
| 642 | - workout_flag = ReadAngles[3]; | 683 | + workout_flag = ReadAngles[3]; |
| 643 | - workout = true; | 684 | + workout = true; |
| 644 | - } | 685 | + } |
| 645 | - //오른쪽 | ||
| 646 | - if (ReadAngles[4] < 95 && workout && workout_flag >= 95) | ||
| 647 | - { | ||
| 648 | - Trainee_Count(); | ||
| 649 | } | 686 | } |
| 650 | - else | 687 | + else { |
| 651 | - { | 688 | + if (flag == 0) |
| 652 | - workout_flag = ReadAngles[4]; | 689 | + { |
| 653 | - workout = true; | 690 | + if (lunge_flag_r < 120 && ReadAngles[4] >= 91 && lunge_flag_r > ReadAngles[4]) |
| 691 | + { | ||
| 692 | + great = ""; | ||
| 693 | + //Great5.SetActive(false); | ||
| 694 | + KneeDown6.SetActive(true); //무릎을 더 굽혀주세요. | ||
| 695 | + flag = 1; | ||
| 696 | + | ||
| 697 | + } | ||
| 698 | + else if (ReadAngles[4] < 91) | ||
| 699 | + { | ||
| 700 | + great = "GREAT!"; | ||
| 701 | + Great5.SetActive(true); | ||
| 702 | + //KneeDown6.SetActive(false); | ||
| 703 | + | ||
| 704 | + flag = 1; | ||
| 705 | + } | ||
| 706 | + } | ||
| 707 | + else | ||
| 708 | + { | ||
| 709 | + | ||
| 710 | + flag_timer += Time.deltaTime; | ||
| 711 | + //Debug.Log(flag_timer); | ||
| 712 | + if (flag_timer > 50) | ||
| 713 | + { | ||
| 714 | + flag = 0; | ||
| 715 | + flag_timer = 0; | ||
| 716 | + Debug.Log("5초넘음"); | ||
| 717 | + | ||
| 718 | + Great5.SetActive(false); | ||
| 719 | + KneeDown6.SetActive(false); | ||
| 720 | + } | ||
| 721 | + } | ||
| 722 | + | ||
| 723 | + //////////////운동 횟수 카운트////////////////// | ||
| 724 | + //오른쪽 | ||
| 725 | + if (workout_count >= 10 && ReadAngles[4] < 95 && workout && workout_flag >= 95) | ||
| 726 | + { | ||
| 727 | + Trainee_Count(); | ||
| 728 | + } | ||
| 729 | + else | ||
| 730 | + { | ||
| 731 | + workout_flag = ReadAngles[4]; | ||
| 732 | + workout = true; | ||
| 733 | + } | ||
| 654 | } | 734 | } |
| 735 | + | ||
| 736 | + | ||
| 737 | + lunge_flag_l = ReadAngles[3]; | ||
| 738 | + lunge_flag_r = ReadAngles[4]; | ||
| 655 | } | 739 | } |
| 656 | 740 | ||
| 657 | //공통된 사항 | 741 | //공통된 사항 | ... | ... |
-
Please register or login to post a comment