고다경

카운트 완성 및 instruction 추가

52.2 KB | W: | H:

18.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -222,7 +222,7 @@ RectTransform:
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 1679758666}
m_RootOrder: 29
m_RootOrder: 26
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -1283,6 +1283,77 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &779933557
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 779933558}
- component: {fileID: 779933560}
- component: {fileID: 779933559}
m_Layer: 5
m_Name: Right_Start
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &779933558
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 779933557}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1679758666}
m_RootOrder: 30
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 250}
m_SizeDelta: {x: 320, y: 130}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &779933559
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 779933557}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Texture: {fileID: 2800000, guid: 8eaaf7c57a8e30649840113180ae24e0, type: 3}
m_UVRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
--- !u!222 &779933560
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 779933557}
m_CullTransparentMesh: 0
--- !u!1 &883974733
GameObject:
m_ObjectHideFlags: 0
......@@ -2070,6 +2141,7 @@ MonoBehaviour:
SideHighKick_Instruction: {fileID: 1616699126}
Lunge_Left_Instruction: {fileID: 1914474766}
Lunge_Right_Instruction: {fileID: 1540314533}
Right_Start: {fileID: 0}
--- !u!4 &1461362268
Transform:
m_ObjectHideFlags: 0
......@@ -2263,7 +2335,7 @@ RectTransform:
m_LocalScale: {x: 8, y: 3, z: 1}
m_Children: []
m_Father: {fileID: 1679758666}
m_RootOrder: 28
m_RootOrder: 29
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......@@ -2483,12 +2555,12 @@ RectTransform:
m_LocalScale: {x: 8, y: 3, z: 1}
m_Children: []
m_Father: {fileID: 1679758666}
m_RootOrder: 26
m_RootOrder: 27
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_SizeDelta: {x: 100, y: 120}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1616699128
MonoBehaviour:
......@@ -2733,10 +2805,11 @@ RectTransform:
- {fileID: 938472433}
- {fileID: 433964838}
- {fileID: 1019081449}
- {fileID: 22123170}
- {fileID: 1616699127}
- {fileID: 1914474767}
- {fileID: 1540314534}
- {fileID: 22123170}
- {fileID: 779933558}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -3090,7 +3163,7 @@ RectTransform:
m_LocalScale: {x: 8, y: 3, z: 1}
m_Children: []
m_Father: {fileID: 1679758666}
m_RootOrder: 27
m_RootOrder: 28
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
......
......@@ -65,15 +65,20 @@ public class Move : MonoBehaviour
string exercise;
int workout_flag, workout_count, workout_flag2;
bool workout;
int sidehk_flag, lunge_flag_l, lunge_flag_r;
private float timer;
private float flag_timer;
int flag;
public GameObject count3;
public GameObject count2;
public GameObject count1;
public GameObject HipBalance1, PullHipBack2, LegUp3, SpineStraight4, Great5, KneeDown6;
public GameObject ex_start;
public GameObject Squat_Instruction, SideHighKick_Instruction, Lunge_Left_Instruction, Lunge_Right_Instruction;
public GameObject Squat_Instruction, SideHighKick_Instruction, Lunge_Left_Instruction, Lunge_Right_Instruction;
public GameObject Right_Start;
//lsy
void Trainer_Run()
......@@ -116,6 +121,8 @@ public class Move : MonoBehaviour
{
if (trainer_timer > 3)
{
Right_Start.SetActive(false);
trainer_count = 0;
lines = lines_right;
trainer_other_side = true;
......@@ -123,6 +130,8 @@ public class Move : MonoBehaviour
}
else
{
Right_Start.SetActive(true);
trainer_timer += Time.deltaTime;
return;
}
......@@ -138,6 +147,8 @@ public class Move : MonoBehaviour
{
if (trainer_timer > 3)
{
Lunge_Right_Instruction.SetActive(false);
trainer_speed = 8;
trainer_count = 0;
lines = lines_right;
......@@ -146,6 +157,8 @@ public class Move : MonoBehaviour
}
else
{
Lunge_Right_Instruction.SetActive(true);
trainer_timer += Time.deltaTime;
return;
}
......@@ -212,6 +225,7 @@ public class Move : MonoBehaviour
workout_count++;
workout = false;
Debug.Log("트레이니: " + workout_count);
}
......@@ -228,7 +242,7 @@ public class Move : MonoBehaviour
//lsy end
exercise = ClickExercise.selected_exercise; //ClickExercise에서 선택한 운동이 무엇인지 String으로 넘어옴.
exercise = "SideHiKick";
exercise = "Squat";
Debug.Log(exercise); //Squat, SideHiKick, Lunge 에 따라서 Trainer움직이고, 사용자에게 instruction주기
if (exercise == "Squat")
......@@ -260,6 +274,12 @@ public class Move : MonoBehaviour
workout_flag2 = 0;
workout = false;
sidehk_flag = 0;
lunge_flag_l = 0;
lunge_flag_r = 0;
flag = 0;
flag_timer = 0;
if (exercise == "Squat")
{
Squat_Instruction.SetActive(true);
......@@ -550,7 +570,7 @@ public class Move : MonoBehaviour
if (ReadAngles[3] < 95 && ReadAngles[4] < 95)
{
great = "GREAT!";
Debug.Log(ReadAngles[3]);
//Debug.Log(ReadAngles[3]);
Great5.SetActive(true);
}
else
......@@ -575,27 +595,23 @@ public class Move : MonoBehaviour
}
else if (exercise == "SideHiKick")
{
if (ReadAngles[7] < 40 || ReadAngles[8] < 40)
if ((ReadAngles[7] < 45) && (ReadAngles[7] > 10)
&& (sidehk_flag < ReadAngles[7]))
{
Debug.Log(ReadAngles[7] + " , " + ReadAngles[8]); //7,8 동일함
LegUp3.SetActive(true); //다리를 더 높이 들어올리세요
Great5.SetActive(false);
}
else if (ReadAngles[7] <= 5)
{
LegUp3.SetActive(false);
}
else
{
LegUp3.SetActive(false);
}
Great5.SetActive(false);
if (ReadAngles[7] >= 40)
{
Great5.SetActive(true); //Great
//이전각도
sidehk_flag = ReadAngles[7];
}
else if (ReadAngles[8] >= 40)
if (ReadAngles[7] >= 45)
{
Great5.SetActive(true); //Great
}
......@@ -605,7 +621,7 @@ public class Move : MonoBehaviour
}
////////운동 횟수 카운트////////////////////
if (ReadAngles[7] > 40 && workout && workout_flag <= 40)
if (ReadAngles[7] > 45 && workout && workout_flag <= 45)
{
Trainee_Count();
}
......@@ -614,44 +630,112 @@ public class Move : MonoBehaviour
workout_flag = ReadAngles[7];
workout = true;
}
}
else if (exercise == "Lunge")
{
if (ReadAngles[3] < 95 || ReadAngles[4] < 95)
{
great = "GREAT!";
Great5.SetActive(true);
KneeDown6.SetActive(false);
}
else
if (workout_count < 10)
{
great = "";
Great5.SetActive(false);
KneeDown6.SetActive(true);
}
if (flag == 0)
{
if (lunge_flag_l < 120 && ReadAngles[3] >= 91 && lunge_flag_l > ReadAngles[3])
{
great = "";
//Great5.SetActive(false);
KneeDown6.SetActive(true); //무릎을 더 굽혀주세요.
flag = 1;
}
else if (ReadAngles[3] < 91)
{
great = "GREAT!";
Great5.SetActive(true);
//KneeDown6.SetActive(false);
flag = 1;
}
}
else {
flag_timer += Time.deltaTime;
//Debug.Log(flag_timer);
if (flag_timer > 50) {
flag = 0;
flag_timer = 0;
Debug.Log("5초넘음");
Great5.SetActive(false);
KneeDown6.SetActive(false);
}
}
//////////////운동 횟수 카운트//////////////////
//왼쪽
if (ReadAngles[3] < 95 && workout && workout_flag >= 95)
{
Trainee_Count();
}
else
{
workout_flag = ReadAngles[3];
workout = true;
}
//오른쪽
if (ReadAngles[4] < 95 && workout && workout_flag >= 95)
{
Trainee_Count();
//////////////운동 횟수 카운트//////////////////
//왼쪽
if (ReadAngles[3] < 95 && workout && workout_flag >= 95)
{
Trainee_Count();
}
else
{
workout_flag = ReadAngles[3];
workout = true;
}
}
else
{
workout_flag = ReadAngles[4];
workout = true;
else {
if (flag == 0)
{
if (lunge_flag_r < 120 && ReadAngles[4] >= 91 && lunge_flag_r > ReadAngles[4])
{
great = "";
//Great5.SetActive(false);
KneeDown6.SetActive(true); //무릎을 더 굽혀주세요.
flag = 1;
}
else if (ReadAngles[4] < 91)
{
great = "GREAT!";
Great5.SetActive(true);
//KneeDown6.SetActive(false);
flag = 1;
}
}
else
{
flag_timer += Time.deltaTime;
//Debug.Log(flag_timer);
if (flag_timer > 50)
{
flag = 0;
flag_timer = 0;
Debug.Log("5초넘음");
Great5.SetActive(false);
KneeDown6.SetActive(false);
}
}
//////////////운동 횟수 카운트//////////////////
//오른쪽
if (workout_count >= 10 && ReadAngles[4] < 95 && workout && workout_flag >= 95)
{
Trainee_Count();
}
else
{
workout_flag = ReadAngles[4];
workout = true;
}
}
lunge_flag_l = ReadAngles[3];
lunge_flag_r = ReadAngles[4];
}
//공통된 사항
......