고다경

Intro, Start Scene 구현 완료

...@@ -24,8 +24,11 @@ public class BodySourceView : MonoBehaviour ...@@ -24,8 +24,11 @@ public class BodySourceView : MonoBehaviour
24 public Text KneeToeRight; 24 public Text KneeToeRight;
25 public Text LeftLegUp; 25 public Text LeftLegUp;
26 public Text RightLegUp; 26 public Text RightLegUp;
27 + public Text PullHipBak;
28 + public Text Great;
27 29
28 string hipbal, leftkneewarning, rightkneewarning, leftsidehighkick, rightsidehighkick; 30 string hipbal, leftkneewarning, rightkneewarning, leftsidehighkick, rightsidehighkick;
31 + string spinestraight, pullhipback, great;
29 32
30 private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>() 33 private Dictionary<Kinect.JointType, Kinect.JointType> _BoneMap = new Dictionary<Kinect.JointType, Kinect.JointType>()
31 { 34 {
......
...@@ -802,7 +802,7 @@ MonoBehaviour: ...@@ -802,7 +802,7 @@ MonoBehaviour:
802 m_EditorClassIdentifier: 802 m_EditorClassIdentifier:
803 BodySrcManager: {fileID: 1330895655} 803 BodySrcManager: {fileID: 1330895655}
804 TrackedJoint: 11 804 TrackedJoint: 11
805 - multiplier: 300 805 + multiplier: 400
806 --- !u!1 &1190618924 806 --- !u!1 &1190618924
807 GameObject: 807 GameObject:
808 m_ObjectHideFlags: 0 808 m_ObjectHideFlags: 0
......
...@@ -1252,7 +1252,7 @@ MonoBehaviour: ...@@ -1252,7 +1252,7 @@ MonoBehaviour:
1252 m_EditorClassIdentifier: 1252 m_EditorClassIdentifier:
1253 BodySrcManager: {fileID: 183612550} 1253 BodySrcManager: {fileID: 183612550}
1254 TrackedJoint: 11 1254 TrackedJoint: 11
1255 - multiplier: 200 1255 + multiplier: 400
1256 --- !u!212 &1793793473 1256 --- !u!212 &1793793473
1257 SpriteRenderer: 1257 SpriteRenderer:
1258 m_ObjectHideFlags: 0 1258 m_ObjectHideFlags: 0
......
...@@ -198,7 +198,7 @@ MonoBehaviour: ...@@ -198,7 +198,7 @@ MonoBehaviour:
198 m_HorizontalOverflow: 0 198 m_HorizontalOverflow: 0
199 m_VerticalOverflow: 0 199 m_VerticalOverflow: 0
200 m_LineSpacing: 1 200 m_LineSpacing: 1
201 - m_Text: New Text 201 + m_Text: HipBalance
202 --- !u!1 &72268619 202 --- !u!1 &72268619
203 GameObject: 203 GameObject:
204 m_ObjectHideFlags: 0 204 m_ObjectHideFlags: 0
...@@ -374,6 +374,84 @@ Transform: ...@@ -374,6 +374,84 @@ Transform:
374 m_Father: {fileID: 0} 374 m_Father: {fileID: 0}
375 m_RootOrder: 0 375 m_RootOrder: 0
376 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 376 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
377 +--- !u!1 &469119554
378 +GameObject:
379 + m_ObjectHideFlags: 0
380 + m_CorrespondingSourceObject: {fileID: 0}
381 + m_PrefabInstance: {fileID: 0}
382 + m_PrefabAsset: {fileID: 0}
383 + serializedVersion: 6
384 + m_Component:
385 + - component: {fileID: 469119555}
386 + - component: {fileID: 469119557}
387 + - component: {fileID: 469119556}
388 + m_Layer: 5
389 + m_Name: PullHipBack
390 + m_TagString: Untagged
391 + m_Icon: {fileID: 0}
392 + m_NavMeshLayer: 0
393 + m_StaticEditorFlags: 0
394 + m_IsActive: 1
395 +--- !u!224 &469119555
396 +RectTransform:
397 + m_ObjectHideFlags: 0
398 + m_CorrespondingSourceObject: {fileID: 0}
399 + m_PrefabInstance: {fileID: 0}
400 + m_PrefabAsset: {fileID: 0}
401 + m_GameObject: {fileID: 469119554}
402 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
403 + m_LocalPosition: {x: 0, y: 0, z: 0}
404 + m_LocalScale: {x: 1, y: 1, z: 1}
405 + m_Children: []
406 + m_Father: {fileID: 1679758666}
407 + m_RootOrder: 8
408 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
409 + m_AnchorMin: {x: 0.5, y: 0.5}
410 + m_AnchorMax: {x: 0.5, y: 0.5}
411 + m_AnchoredPosition: {x: 0, y: 0}
412 + m_SizeDelta: {x: 160, y: 30}
413 + m_Pivot: {x: 0.5, y: 0.5}
414 +--- !u!114 &469119556
415 +MonoBehaviour:
416 + m_ObjectHideFlags: 0
417 + m_CorrespondingSourceObject: {fileID: 0}
418 + m_PrefabInstance: {fileID: 0}
419 + m_PrefabAsset: {fileID: 0}
420 + m_GameObject: {fileID: 469119554}
421 + m_Enabled: 1
422 + m_EditorHideFlags: 0
423 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
424 + m_Name:
425 + m_EditorClassIdentifier:
426 + m_Material: {fileID: 0}
427 + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
428 + m_RaycastTarget: 1
429 + m_Maskable: 1
430 + m_OnCullStateChanged:
431 + m_PersistentCalls:
432 + m_Calls: []
433 + m_FontData:
434 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
435 + m_FontSize: 14
436 + m_FontStyle: 0
437 + m_BestFit: 0
438 + m_MinSize: 10
439 + m_MaxSize: 40
440 + m_Alignment: 0
441 + m_AlignByGeometry: 0
442 + m_RichText: 1
443 + m_HorizontalOverflow: 0
444 + m_VerticalOverflow: 0
445 + m_LineSpacing: 1
446 + m_Text: PullHipBack
447 +--- !u!222 &469119557
448 +CanvasRenderer:
449 + m_ObjectHideFlags: 0
450 + m_CorrespondingSourceObject: {fileID: 0}
451 + m_PrefabInstance: {fileID: 0}
452 + m_PrefabAsset: {fileID: 0}
453 + m_GameObject: {fileID: 469119554}
454 + m_CullTransparentMesh: 0
377 --- !u!1 &505897242 455 --- !u!1 &505897242
378 GameObject: 456 GameObject:
379 m_ObjectHideFlags: 0 457 m_ObjectHideFlags: 0
...@@ -518,7 +596,7 @@ MonoBehaviour: ...@@ -518,7 +596,7 @@ MonoBehaviour:
518 m_HorizontalOverflow: 0 596 m_HorizontalOverflow: 0
519 m_VerticalOverflow: 0 597 m_VerticalOverflow: 0
520 m_LineSpacing: 1 598 m_LineSpacing: 1
521 - m_Text: New Text 599 + m_Text:
522 --- !u!1 &687225089 600 --- !u!1 &687225089
523 GameObject: 601 GameObject:
524 m_ObjectHideFlags: 0 602 m_ObjectHideFlags: 0
...@@ -569,7 +647,7 @@ MonoBehaviour: ...@@ -569,7 +647,7 @@ MonoBehaviour:
569 m_HorizontalOverflow: 0 647 m_HorizontalOverflow: 0
570 m_VerticalOverflow: 0 648 m_VerticalOverflow: 0
571 m_LineSpacing: 1 649 m_LineSpacing: 1
572 - m_Text: New Text 650 + m_Text: RightLegUp
573 --- !u!222 &687225091 651 --- !u!222 &687225091
574 CanvasRenderer: 652 CanvasRenderer:
575 m_ObjectHideFlags: 0 653 m_ObjectHideFlags: 0
...@@ -674,7 +752,7 @@ MonoBehaviour: ...@@ -674,7 +752,7 @@ MonoBehaviour:
674 m_HorizontalOverflow: 0 752 m_HorizontalOverflow: 0
675 m_VerticalOverflow: 0 753 m_VerticalOverflow: 0
676 m_LineSpacing: 1 754 m_LineSpacing: 1
677 - m_Text: New Text 755 + m_Text: IfSpinelsStraight
678 --- !u!1 &1150688360 756 --- !u!1 &1150688360
679 GameObject: 757 GameObject:
680 m_ObjectHideFlags: 0 758 m_ObjectHideFlags: 0
...@@ -914,7 +992,7 @@ MonoBehaviour: ...@@ -914,7 +992,7 @@ MonoBehaviour:
914 m_HorizontalOverflow: 0 992 m_HorizontalOverflow: 0
915 m_VerticalOverflow: 0 993 m_VerticalOverflow: 0
916 m_LineSpacing: 1 994 m_LineSpacing: 1
917 - m_Text: New Text 995 + m_Text:
918 --- !u!1 &1437275810 996 --- !u!1 &1437275810
919 GameObject: 997 GameObject:
920 m_ObjectHideFlags: 0 998 m_ObjectHideFlags: 0
...@@ -987,7 +1065,7 @@ MonoBehaviour: ...@@ -987,7 +1065,7 @@ MonoBehaviour:
987 m_Script: {fileID: 11500000, guid: 819eb0cfd2d3e7c439a730d87e92e292, type: 3} 1065 m_Script: {fileID: 11500000, guid: 819eb0cfd2d3e7c439a730d87e92e292, type: 3}
988 m_Name: 1066 m_Name:
989 m_EditorClassIdentifier: 1067 m_EditorClassIdentifier:
990 - BodySourceManager: {fileID: 0} 1068 + BodySourceManager: {fileID: 1437275810}
991 Trainnner: {fileID: 1840191323} 1069 Trainnner: {fileID: 1840191323}
992 Trainnne: {fileID: 1151125687} 1070 Trainnne: {fileID: 1151125687}
993 mirror: 1 1071 mirror: 1
...@@ -997,14 +1075,16 @@ MonoBehaviour: ...@@ -997,14 +1075,16 @@ MonoBehaviour:
997 trainer_j: 0 1075 trainer_j: 0
998 trainer_data1: [] 1076 trainer_data1: []
999 trainer_state: 1077 trainer_state:
1000 - IfSpineIsStraight: {fileID: 883974736}
1001 - HipBalance: {fileID: 64300837}
1002 AngleLeftKnee: {fileID: 1313906998} 1078 AngleLeftKnee: {fileID: 1313906998}
1003 AngleRightKnee: {fileID: 1543390839} 1079 AngleRightKnee: {fileID: 1543390839}
1004 KneeToeLeft: {fileID: 2059169298} 1080 KneeToeLeft: {fileID: 2059169298}
1005 KneeToeRight: {fileID: 618891446} 1081 KneeToeRight: {fileID: 618891446}
1006 LeftLegUp: {fileID: 1493856869} 1082 LeftLegUp: {fileID: 1493856869}
1007 RightLegUp: {fileID: 687225090} 1083 RightLegUp: {fileID: 687225090}
1084 + IfSpineIsStraight: {fileID: 883974736}
1085 + HipBalance: {fileID: 64300837}
1086 + PullHipBack: {fileID: 469119556}
1087 + Great: {fileID: 1784424919}
1008 --- !u!4 &1461362268 1088 --- !u!4 &1461362268
1009 Transform: 1089 Transform:
1010 m_ObjectHideFlags: 0 1090 m_ObjectHideFlags: 0
...@@ -1096,7 +1176,7 @@ MonoBehaviour: ...@@ -1096,7 +1176,7 @@ MonoBehaviour:
1096 m_HorizontalOverflow: 0 1176 m_HorizontalOverflow: 0
1097 m_VerticalOverflow: 0 1177 m_VerticalOverflow: 0
1098 m_LineSpacing: 1 1178 m_LineSpacing: 1
1099 - m_Text: New Text 1179 + m_Text: LeftLegUp
1100 --- !u!1 &1543390836 1180 --- !u!1 &1543390836
1101 GameObject: 1181 GameObject:
1102 m_ObjectHideFlags: 0 1182 m_ObjectHideFlags: 0
...@@ -1131,7 +1211,7 @@ RectTransform: ...@@ -1131,7 +1211,7 @@ RectTransform:
1131 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1211 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1132 m_AnchorMin: {x: 0.5, y: 0.5} 1212 m_AnchorMin: {x: 0.5, y: 0.5}
1133 m_AnchorMax: {x: 0.5, y: 0.5} 1213 m_AnchorMax: {x: 0.5, y: 0.5}
1134 - m_AnchoredPosition: {x: 0, y: 0} 1214 + m_AnchoredPosition: {x: 200, y: 0}
1135 m_SizeDelta: {x: 160, y: 30} 1215 m_SizeDelta: {x: 160, y: 30}
1136 m_Pivot: {x: 0.5, y: 0.5} 1216 m_Pivot: {x: 0.5, y: 0.5}
1137 --- !u!222 &1543390838 1217 --- !u!222 &1543390838
...@@ -1174,7 +1254,7 @@ MonoBehaviour: ...@@ -1174,7 +1254,7 @@ MonoBehaviour:
1174 m_HorizontalOverflow: 0 1254 m_HorizontalOverflow: 0
1175 m_VerticalOverflow: 0 1255 m_VerticalOverflow: 0
1176 m_LineSpacing: 1 1256 m_LineSpacing: 1
1177 - m_Text: New Text 1257 + m_Text:
1178 --- !u!1 &1642118724 1258 --- !u!1 &1642118724
1179 GameObject: 1259 GameObject:
1180 m_ObjectHideFlags: 0 1260 m_ObjectHideFlags: 0
...@@ -1295,6 +1375,8 @@ RectTransform: ...@@ -1295,6 +1375,8 @@ RectTransform:
1295 - {fileID: 618891444} 1375 - {fileID: 618891444}
1296 - {fileID: 1493856867} 1376 - {fileID: 1493856867}
1297 - {fileID: 687225092} 1377 - {fileID: 687225092}
1378 + - {fileID: 469119555}
1379 + - {fileID: 1784424918}
1298 m_Father: {fileID: 0} 1380 m_Father: {fileID: 0}
1299 m_RootOrder: 4 1381 m_RootOrder: 4
1300 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 1382 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
...@@ -1363,6 +1445,84 @@ Canvas: ...@@ -1363,6 +1445,84 @@ Canvas:
1363 m_SortingLayerID: 0 1445 m_SortingLayerID: 0
1364 m_SortingOrder: 0 1446 m_SortingOrder: 0
1365 m_TargetDisplay: 0 1447 m_TargetDisplay: 0
1448 +--- !u!1 &1784424917
1449 +GameObject:
1450 + m_ObjectHideFlags: 0
1451 + m_CorrespondingSourceObject: {fileID: 0}
1452 + m_PrefabInstance: {fileID: 0}
1453 + m_PrefabAsset: {fileID: 0}
1454 + serializedVersion: 6
1455 + m_Component:
1456 + - component: {fileID: 1784424918}
1457 + - component: {fileID: 1784424920}
1458 + - component: {fileID: 1784424919}
1459 + m_Layer: 5
1460 + m_Name: Great
1461 + m_TagString: Untagged
1462 + m_Icon: {fileID: 0}
1463 + m_NavMeshLayer: 0
1464 + m_StaticEditorFlags: 0
1465 + m_IsActive: 1
1466 +--- !u!224 &1784424918
1467 +RectTransform:
1468 + m_ObjectHideFlags: 0
1469 + m_CorrespondingSourceObject: {fileID: 0}
1470 + m_PrefabInstance: {fileID: 0}
1471 + m_PrefabAsset: {fileID: 0}
1472 + m_GameObject: {fileID: 1784424917}
1473 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
1474 + m_LocalPosition: {x: 0, y: 0, z: 0}
1475 + m_LocalScale: {x: 3, y: 5, z: 1}
1476 + m_Children: []
1477 + m_Father: {fileID: 1679758666}
1478 + m_RootOrder: 9
1479 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1480 + m_AnchorMin: {x: 0.5, y: 0.5}
1481 + m_AnchorMax: {x: 0.5, y: 0.5}
1482 + m_AnchoredPosition: {x: 400, y: 160}
1483 + m_SizeDelta: {x: 160, y: 30}
1484 + m_Pivot: {x: 0.5, y: 0.5}
1485 +--- !u!114 &1784424919
1486 +MonoBehaviour:
1487 + m_ObjectHideFlags: 0
1488 + m_CorrespondingSourceObject: {fileID: 0}
1489 + m_PrefabInstance: {fileID: 0}
1490 + m_PrefabAsset: {fileID: 0}
1491 + m_GameObject: {fileID: 1784424917}
1492 + m_Enabled: 1
1493 + m_EditorHideFlags: 0
1494 + m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
1495 + m_Name:
1496 + m_EditorClassIdentifier:
1497 + m_Material: {fileID: 0}
1498 + m_Color: {r: 1, g: 1, b: 1, a: 1}
1499 + m_RaycastTarget: 1
1500 + m_Maskable: 1
1501 + m_OnCullStateChanged:
1502 + m_PersistentCalls:
1503 + m_Calls: []
1504 + m_FontData:
1505 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
1506 + m_FontSize: 20
1507 + m_FontStyle: 0
1508 + m_BestFit: 0
1509 + m_MinSize: 2
1510 + m_MaxSize: 40
1511 + m_Alignment: 0
1512 + m_AlignByGeometry: 0
1513 + m_RichText: 1
1514 + m_HorizontalOverflow: 0
1515 + m_VerticalOverflow: 0
1516 + m_LineSpacing: 1
1517 + m_Text: Great!
1518 +--- !u!222 &1784424920
1519 +CanvasRenderer:
1520 + m_ObjectHideFlags: 0
1521 + m_CorrespondingSourceObject: {fileID: 0}
1522 + m_PrefabInstance: {fileID: 0}
1523 + m_PrefabAsset: {fileID: 0}
1524 + m_GameObject: {fileID: 1784424917}
1525 + m_CullTransparentMesh: 0
1366 --- !u!1001 &1840191322 1526 --- !u!1001 &1840191322
1367 PrefabInstance: 1527 PrefabInstance:
1368 m_ObjectHideFlags: 0 1528 m_ObjectHideFlags: 0
...@@ -1546,4 +1706,4 @@ MonoBehaviour: ...@@ -1546,4 +1706,4 @@ MonoBehaviour:
1546 m_HorizontalOverflow: 0 1706 m_HorizontalOverflow: 0
1547 m_VerticalOverflow: 0 1707 m_VerticalOverflow: 0
1548 m_LineSpacing: 1 1708 m_LineSpacing: 1
1549 - m_Text: New Text 1709 + m_Text:
......
...@@ -20,9 +20,11 @@ public class ClickExercise : MonoBehaviour ...@@ -20,9 +20,11 @@ public class ClickExercise : MonoBehaviour
20 20
21 follow = GameObject.Find("follow").gameObject; 21 follow = GameObject.Find("follow").gameObject;
22 pos = follow.transform.position; 22 pos = follow.transform.position;
23 - Debug.Log(pos); 23 + follow.transform.position = new Vector3(400, 190, 200);
24 + //Debug.Log(pos);
24 } 25 }
25 26
27 + /*
26 public void GetBtn() 28 public void GetBtn()
27 { 29 {
28 Debug.Log("GetBtn"); 30 Debug.Log("GetBtn");
...@@ -54,10 +56,12 @@ public class ClickExercise : MonoBehaviour ...@@ -54,10 +56,12 @@ public class ClickExercise : MonoBehaviour
54 56
55 if (btnImage.name == "Squat") 57 if (btnImage.name == "Squat")
56 { 58 {
59 + Debug.Log("Squat");
57 btnImage.texture = Resources.Load("Squat_on", typeof(Texture2D)) as Texture2D; 60 btnImage.texture = Resources.Load("Squat_on", typeof(Texture2D)) as Texture2D;
58 } 61 }
59 else if (btnImage.name == "Lunge") 62 else if (btnImage.name == "Lunge")
60 { 63 {
64 + Debug.Log("Lunge");
61 btnImage.texture = Resources.Load("Lunge_on", typeof(Texture2D)) as Texture2D; 65 btnImage.texture = Resources.Load("Lunge_on", typeof(Texture2D)) as Texture2D;
62 } 66 }
63 else if (btnImage.name == "SideHiKick") 67 else if (btnImage.name == "SideHiKick")
...@@ -66,23 +70,108 @@ public class ClickExercise : MonoBehaviour ...@@ -66,23 +70,108 @@ public class ClickExercise : MonoBehaviour
66 btnImage.texture = Resources.Load("SideHiKick_on", typeof(Texture2D)) as Texture2D; 70 btnImage.texture = Resources.Load("SideHiKick_on", typeof(Texture2D)) as Texture2D;
67 } 71 }
68 72
73 +
74 + //Squat x:60~285 , y:355~640 , z:300
75 + //SideHighKick x:400 ~ 625, y:355~640, z:300
76 + //Lunge x:735~965 , y:355~640 , z:300
69 77
70 } 78 }
79 + */
71 80
72 void Update() 81 void Update()
73 { 82 {
74 83
75 pos = follow.transform.position; 84 pos = follow.transform.position;
76 - Debug.Log(pos); 85 + // Debug.Log(pos);
77 86
78 - /*
79 - if (pos.x >= 155 && pos.x <= 185 && pos.y >= 13 && pos.y <= 60) {
80 87
81 - btnImage2.texture = Resources.Load("Squat_off", typeof(Texture2D)) as Texture2D; 88 + if (pos.x >= 60 && pos.x <= 285 && pos.y >= 335 && pos.y <= 640 && pos.z == 200) {
82 - btnImage.texture = Resources.Load("SideHiKick_on", typeof(Texture2D)) as Texture2D; 89 + //스쿼트
83 - btnImage2.texture = Resources.Load("Lunge_off", typeof(Texture2D)) as Texture2D; 90 + timer += Time.deltaTime;
91 + Debug.Log("Timer: " + timer);
92 +
93 + if (timer > 2.5)
94 + {
95 + Debug.Log("Clicked");
96 + //////
97 + GameObject tempBtn = btnParent.transform.GetChild(3).gameObject;
98 + btnImage = tempBtn.GetComponent<RawImage>(); // 해당 오브젝트의 image 컴포넌트를 받음
99 +
100 + if (btnImage.name == "Squat")
101 + {
102 + Debug.Log("Squat");
103 + btnImage.texture = Resources.Load("Squat_on", typeof(Texture2D)) as Texture2D;
104 + }
105 +
106 + GameObject sidehk = btnParent.transform.GetChild(2).gameObject;
107 + btnImage2 = sidehk.GetComponent<RawImage>();
108 + btnImage2.texture = Resources.Load("SideHiKick_off", typeof(Texture2D)) as Texture2D;
109 +
110 + GameObject lunge = btnParent.transform.GetChild(1).gameObject;
111 + btnImage2 = lunge.GetComponent<RawImage>();
112 + btnImage2.texture = Resources.Load("Lunge_off", typeof(Texture2D)) as Texture2D;
113 + }
114 +
84 } 115 }
85 - 116 + else if(pos.x >= 400 && pos.x <= 625 && pos.y >= 335 && pos.y <= 640 && pos.z == 200){
86 - */ 117 + //사이드하이킥
118 + timer += Time.deltaTime;
119 + Debug.Log("Timer: " + timer);
120 +
121 + if (timer > 2.5)
122 + {
123 + Debug.Log("Clicked");
124 + /////
125 + GameObject tempBtn = btnParent.transform.GetChild(2).gameObject;
126 + btnImage = tempBtn.GetComponent<RawImage>(); // 해당 오브젝트의 image 컴포넌트를 받음
127 +
128 + if (btnImage.name == "SideHiKick")
129 + {
130 + Debug.Log("SideHiKick");
131 + btnImage.texture = Resources.Load("SideHiKick_on", typeof(Texture2D)) as Texture2D;
132 + }
133 +
134 + GameObject squat = btnParent.transform.GetChild(3).gameObject;
135 + btnImage2 = squat.GetComponent<RawImage>();
136 + btnImage2.texture = Resources.Load("Squat_off", typeof(Texture2D)) as Texture2D;
137 +
138 + GameObject lunge = btnParent.transform.GetChild(1).gameObject;
139 + btnImage2 = lunge.GetComponent<RawImage>();
140 + btnImage2.texture = Resources.Load("Lunge_off", typeof(Texture2D)) as Texture2D;
141 +
142 + }
143 + }
144 + else if (pos.x >= 735 && pos.x <= 965 && pos.y >= 335 && pos.y <= 640 && pos.z == 200)
145 + {
146 + //런지
147 + timer += Time.deltaTime;
148 + Debug.Log("Timer: " + timer);
149 +
150 + if (timer > 2.5)
151 + {
152 + Debug.Log("Clicked");
153 + //////
154 +
155 + GameObject tempBtn = btnParent.transform.GetChild(1).gameObject;
156 + btnImage = tempBtn.GetComponent<RawImage>(); // 해당 오브젝트의 image 컴포넌트를 받음
157 +
158 + if (btnImage.name == "Lunge")
159 + {
160 + Debug.Log("Lunge");
161 + btnImage.texture = Resources.Load("Lunge_on", typeof(Texture2D)) as Texture2D;
162 + }
163 +
164 + GameObject squat = btnParent.transform.GetChild(3).gameObject;
165 + btnImage2 = squat.GetComponent<RawImage>();
166 + btnImage2.texture = Resources.Load("Squat_off", typeof(Texture2D)) as Texture2D;
167 +
168 + GameObject sidehk = btnParent.transform.GetChild(2).gameObject;
169 + btnImage2 = sidehk.GetComponent<RawImage>();
170 + btnImage2.texture = Resources.Load("SideHiKick_off", typeof(Texture2D)) as Texture2D;
171 +
172 + }
173 + }
174 +
175 +
87 } 176 }
88 } 177 }
......
...@@ -49,7 +49,8 @@ public class DetectJoints : MonoBehaviour ...@@ -49,7 +49,8 @@ public class DetectJoints : MonoBehaviour
49 { 49 {
50 var pos = body.Joints[TrackedJoint].Position; 50 var pos = body.Joints[TrackedJoint].Position;
51 //gameObject.transform.position = new Vector3(pos.X*multiplier, pos.Y*multiplier); 51 //gameObject.transform.position = new Vector3(pos.X*multiplier, pos.Y*multiplier);
52 - gameObject.transform.position = new Vector3(pos.X * multiplier * 2, pos.Y * multiplier, multiplier/2); 52 +
53 + gameObject.transform.position = new Vector3(pos.X * multiplier * 2, pos.Y * multiplier *2, multiplier/2);
53 } 54 }
54 } 55 }
55 56
......
...@@ -38,10 +38,7 @@ public class Move : MonoBehaviour ...@@ -38,10 +38,7 @@ public class Move : MonoBehaviour
38 public float[] trainer_data1; 38 public float[] trainer_data1;
39 public int[] trainer_state; 39 public int[] trainer_state;
40 //lsy end 40 //lsy end
41 - 41 +
42 -
43 - public Text IfSpineIsStraight;
44 - public Text HipBalance;
45 public Text AngleLeftKnee; 42 public Text AngleLeftKnee;
46 public Text AngleRightKnee; 43 public Text AngleRightKnee;
47 public Text KneeToeLeft; 44 public Text KneeToeLeft;
...@@ -49,7 +46,13 @@ public class Move : MonoBehaviour ...@@ -49,7 +46,13 @@ public class Move : MonoBehaviour
49 public Text LeftLegUp; 46 public Text LeftLegUp;
50 public Text RightLegUp; 47 public Text RightLegUp;
51 48
49 + public Text IfSpineIsStraight;
50 + public Text HipBalance;
51 + public Text PullHipBack;
52 + public Text Great;
53 +
52 string hipbal, leftkneewarning, rightkneewarning, leftsidehighkick, rightsidehighkick; 54 string hipbal, leftkneewarning, rightkneewarning, leftsidehighkick, rightsidehighkick;
55 + string spinestraight, pullhipback, great;
53 56
54 //lsy 57 //lsy
55 void Trainer_Run() 58 void Trainer_Run()
...@@ -148,13 +151,16 @@ public class Move : MonoBehaviour ...@@ -148,13 +151,16 @@ public class Move : MonoBehaviour
148 151
149 IfSpineIsStraight.text = "허리를 곧게: Tracking"; 152 IfSpineIsStraight.text = "허리를 곧게: Tracking";
150 HipBalance.text = "양쪽 힙 균형: Calculating"; 153 HipBalance.text = "양쪽 힙 균형: Calculating";
151 - AngleLeftKnee.text = "왼쪽 무릎 각도: Tracking"; 154 + AngleLeftKnee.text = "";
152 - AngleRightKnee.text = "오른쪽 무릎 각도: Tracking"; 155 + AngleRightKnee.text = "";
153 - KneeToeLeft.text = "왼쪽 무릎과 발끝: Tracking"; 156 + KneeToeLeft.text = "";
154 - KneeToeRight.text = "오른쪽 무릎과 발끝: Tracking"; 157 + KneeToeRight.text = "";
155 LeftLegUp.text = "왼쪽 다리 들어올린 각도: Tracking"; 158 LeftLegUp.text = "왼쪽 다리 들어올린 각도: Tracking";
156 RightLegUp.text = "오른쪽 다리 들어올린 각도: Tracking"; 159 RightLegUp.text = "오른쪽 다리 들어올린 각도: Tracking";
157 160
161 + PullHipBack.text = "";
162 + Great.text = "";
163 +
158 float[] data1 = new float[bodyCount * jointCount * 3]; 164 float[] data1 = new float[bodyCount * jointCount * 3];
159 int[] state = new int[bodyCount * jointCount]; 165 int[] state = new int[bodyCount * jointCount];
160 int[] id = new int[bodyCount]; 166 int[] id = new int[bodyCount];
...@@ -275,16 +281,18 @@ public class Move : MonoBehaviour ...@@ -275,16 +281,18 @@ public class Move : MonoBehaviour
275 281
276 if (ReadAngles[1] - ReadAngles[2] <= 5) 282 if (ReadAngles[1] - ReadAngles[2] <= 5)
277 { 283 {
278 - hipbal = "양쪽 균형이 잡혀있습니다."; 284 + hipbal = "";
285 + //hipbal = "양쪽 균형이 잡혀있습니다.";
279 } 286 }
280 else 287 else
281 { 288 {
282 - hipbal = "양쪽 힘이 동일하지 않습니다. 균형을 잡으세요"; 289 + hipbal = "양쪽 힘이 동일하지 않습니다. \n균형을 잡으세요!";
283 } 290 }
284 291
285 if (ReadAngles[5] > 90) 292 if (ReadAngles[5] > 90)
286 { 293 {
287 - leftkneewarning = "왼쪽 무릎이 발끝을 넘어갔습니다."; 294 + //leftkneewarning = "왼쪽 무릎이 발끝을 넘어갔습니다.";
295 + pullhipback = "엉덩이를 뒤로 더 빼세요!";
288 } 296 }
289 else 297 else
290 { 298 {
...@@ -292,7 +300,8 @@ public class Move : MonoBehaviour ...@@ -292,7 +300,8 @@ public class Move : MonoBehaviour
292 } 300 }
293 if (ReadAngles[6] > 90) 301 if (ReadAngles[6] > 90)
294 { 302 {
295 - rightkneewarning = "오른쪽 무릎이 발끝을 넘어갔습니다."; 303 + //rightkneewarning = "오른쪽 무릎이 발끝을 넘어갔습니다.";
304 + pullhipback = "엉덩이를 뒤로 더 빼세요!";
296 } 305 }
297 else 306 else
298 { 307 {
...@@ -317,15 +326,32 @@ public class Move : MonoBehaviour ...@@ -317,15 +326,32 @@ public class Move : MonoBehaviour
317 rightsidehighkick = ""; 326 rightsidehighkick = "";
318 } 327 }
319 328
329 + if (ReadAngles[0] < 170 || ReadAngles[0] > 190)
330 + {
331 + spinestraight = "허리를 곧게 펴세요!";
332 + }
333 + else {
334 + spinestraight = "";
335 + }
336 +
337 + if (ReadAngles[3] < 100 || ReadAngles[4] < 100)
338 + {
339 + great = "GREAT!";
340 + }
341 + else {
342 + great = "";
343 + }
320 344
321 - IfSpineIsStraight.text = "허리를 곧게: " + ReadAngles[0].ToString(); 345 + IfSpineIsStraight.text =spinestraight;
322 - HipBalance.text = "양쪽 힙 균형: " + hipbal; 346 + HipBalance.text = hipbal;
323 - AngleLeftKnee.text = "왼쪽 무릎 각도: " + ReadAngles[3].ToString(); 347 + //AngleLeftKnee.text = "왼쪽 무릎 각도: " + ReadAngles[3].ToString();
324 - AngleRightKnee.text = "오른쪽 무릎 각도: " + ReadAngles[4].ToString(); 348 + //AngleRightKnee.text = "오른쪽 무릎 각도: " + ReadAngles[4].ToString();
325 - KneeToeLeft.text = "올바르지 않은 자세: " + leftkneewarning; 349 + //KneeToeLeft.text = "올바르지 않은 자세: " + leftkneewarning;
326 - KneeToeRight.text = "올바르지 않은 자세: " + rightkneewarning; 350 + //KneeToeRight.text = "올바르지 않은 자세: " + rightkneewarning;
327 - LeftLegUp.text = "왼쪽 다리 운동중: " + leftsidehighkick; 351 + PullHipBack.text = pullhipback;
328 - RightLegUp.text = "오른쪽 다리 운동중: " + rightsidehighkick; 352 + LeftLegUp.text = leftsidehighkick;
353 + RightLegUp.text = rightsidehighkick;
354 + Great.text = great;
329 355
330 /////////////////////////// 356 ///////////////////////////
331 357
......
...@@ -32,11 +32,11 @@ public class Title : MonoBehaviour ...@@ -32,11 +32,11 @@ public class Title : MonoBehaviour
32 Debug.Log(pos); 32 Debug.Log(pos);
33 33
34 34
35 - if (pos.x >= 340 && pos.x <= 600 && pos.y >= 175 && pos.y <= 224 &&pos.z == 150) { 35 + if (pos.x >= 360 && pos.x <= 600 && pos.y >= 180 && pos.y <= 200 &&pos.z == 200) {
36 timer += Time.deltaTime; 36 timer += Time.deltaTime;
37 Debug.Log("Timer: "+ timer); 37 Debug.Log("Timer: "+ timer);
38 38
39 - if (timer > 2) { 39 + if (timer > 2.5) {
40 Debug.Log("Clicked"); 40 Debug.Log("Clicked");
41 SceneManager.LoadScene(SceneToLoad); 41 SceneManager.LoadScene(SceneToLoad);
42 } 42 }
......