Commit 969139ca authored by Chae Ho Shin's avatar Chae Ho Shin
parents f1259523 cf75c447
......@@ -22,16 +22,25 @@ public class Clap : MotionNote
public override void Checkpoint()
{
<<<<<<< HEAD
IsChecked = (InputManager.Instance.CurrentMotionState
& MotionState.CLAP_PREPARE) != 0;
=======
var motion = InputManager.Instance.CurrentMotionState;
if ((motion & MotionState.CLAP_PREPARE) == 0)
return;
IsChecked = true;
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
}
public override bool FinalJudgeAction()
{
<<<<<<< HEAD
return (InputManager.Instance.CurrentMotionState
& MotionState.CLAP_DONE) != 0;
=======
var motion = InputManager.Instance.CurrentMotionState;
if (IsChecked && (motion & MotionState.CLAP_DONE) != 0)
......@@ -40,5 +49,6 @@ public class Clap : MotionNote
}
return false;
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
}
}
......@@ -7,10 +7,16 @@ public class Guard : MotionNote
enum Hand { Both, Left, Right }
Hand hand;
<<<<<<< HEAD
MotionState prepare, done;
private static Sprite image;
=======
private static Sprite imageB = LoadNewSprite("");
private static Sprite imageL = LoadNewSprite("");
private static Sprite imageR = LoadNewSprite("");
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
public override Sprite Image
{
get
......@@ -37,44 +43,65 @@ public class Guard : MotionNote
}
}
<<<<<<< HEAD
public Guard(string key, float timing) : this(timing)
=======
public Guard(string key, float timing) : this(key, timing, 0f)
{
}
public Guard(string key, float timing, float end = 0f) : this(timing, end)
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
{
switch (key)
{
case "BG":
hand = Hand.Both;
image = LoadNewSprite("BG");
prepare = MotionState.GUARD_BASE_LEFT | MotionState.GUARD_BASE_RIGHT
| MotionState.HAND_MOVE_DOWN_LEFT | MotionState.HAND_MOVE_DOWN_RIGHT;
done = MotionState.GUARD_BASE_LEFT | MotionState.GUARD_BASE_RIGHT
| MotionState.HAND_MOVE_UP_LEFT | MotionState.HAND_MOVE_UP_RIGHT;
break;
case "LG":
hand = Hand.Left;
image = LoadNewSprite("LG");
prepare = MotionState.GUARD_BASE_LEFT
| MotionState.HAND_MOVE_DOWN_LEFT;
done = MotionState.GUARD_BASE_LEFT
| MotionState.HAND_MOVE_UP_LEFT;
break;
case "RG":
hand = Hand.Right;
image = LoadNewSprite("RG");
prepare = MotionState.GUARD_BASE_RIGHT
| MotionState.HAND_MOVE_DOWN_RIGHT;
done = MotionState.GUARD_BASE_RIGHT
| MotionState.HAND_MOVE_UP_RIGHT;
break;
}
}
public Guard(float timing, float end = 0f) : base(timing, end)
public Guard(float timing) : base(timing)
{
}
<<<<<<< HEAD
public override void Checkpoint()
=======
public override IEnumerator Checkpoint(MotionNote obj)
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
while (motion != MotionState.CLAP_PREPARE)
yield return false;
Activated = true;
yield break;
IsChecked = (InputManager.Instance.CurrentMotionState
& prepare) != 0;
}
public override bool FinalJudgeAction()
{
<<<<<<< HEAD
return (InputManager.Instance.CurrentMotionState
& done) != 0;
=======
return false;
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
}
}
fileFormatVersion: 2
guid: 9335418863367cf4fb5c77889556b26a
timeCreated: 1503548782
timeCreated: 1503639949
licenseType: Free
MonoImporter:
serializedVersion: 2
......
using System;
using System.Collections;
using UnityEngine;
public class HandDown : MotionNote
{
enum Hand { Both, Left, Right }
Hand hand;
MotionState done;
private static Sprite image;
public override Sprite Image
{
get
{
return image;
}
}
public HandDown(string key, float timing) : this(timing)
{
switch (key)
{
case "BD":
hand = Hand.Both;
image = LoadNewSprite("BD");
done = MotionState.HAND_DOWN_LEFT | MotionState.HAND_DOWN_RIGHT;
break;
case "LD":
hand = Hand.Left;
image = LoadNewSprite("LD");
done = MotionState.HAND_DOWN_LEFT;
break;
case "RD":
hand = Hand.Right;
image = LoadNewSprite("RD");
done = MotionState.HAND_DOWN_RIGHT;
break;
}
}
public HandDown(float timing) : base(timing)
{
}
public override void Checkpoint()
{
IsChecked = true;
}
public override bool FinalJudgeAction()
{
return (InputManager.Instance.CurrentMotionState
& done) != 0;
}
}
fileFormatVersion: 2
guid: 0a95b7cf44f588a478ab3d020a20d647
timeCreated: 1503640030
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using UnityEngine;
public class HandUp : MotionNote
{
enum Hand { Both, Left, Right }
Hand hand;
MotionState done;
private static Sprite image;
public override Sprite Image
{
get
{
return image;
}
}
public HandUp(string key, float timing) : this(timing)
{
switch (key)
{
case "BU":
hand = Hand.Both;
image = LoadNewSprite("BU");
done = MotionState.HAND_UP_LEFT | MotionState.HAND_UP_RIGHT;
break;
case "LU":
hand = Hand.Left;
image = LoadNewSprite("LU");
done = MotionState.HAND_UP_LEFT;
break;
case "RU":
hand = Hand.Right;
image = LoadNewSprite("RU");
done = MotionState.HAND_UP_RIGHT;
break;
}
}
public HandUp(float timing) : base(timing)
{
}
public override void Checkpoint()
{
IsChecked = true;
}
public override bool FinalJudgeAction()
{
return (InputManager.Instance.CurrentMotionState
& done) != 0;
}
}
fileFormatVersion: 2
guid: be9752588c388ac4d985d31009c56a33
timeCreated: 1503640021
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using UnityEngine;
public class Headphone : MotionNote
{
enum Hand { Both, Left, Right }
Hand hand;
MotionState done;
private static Sprite image;
public override Sprite Image
{
get
{
return image;
}
}
public Headphone(string key, float timing) : this(timing)
{
switch (key)
{
case "BH":
hand = Hand.Both;
image = LoadNewSprite("BH");
done = MotionState.HEADPHONE_LEFT | MotionState.HEADPHONE_RIGHT;
break;
case "LH":
hand = Hand.Left;
image = LoadNewSprite("LH");
done = MotionState.HEADPHONE_LEFT;
break;
case "RH":
hand = Hand.Right;
image = LoadNewSprite("RH");
done = MotionState.HEADPHONE_RIGHT;
break;
}
}
public Headphone(float timing) : base(timing)
{
}
public override void Checkpoint()
{
IsChecked = true;
}
public override bool FinalJudgeAction()
{
return (InputManager.Instance.CurrentMotionState
& done) != 0;
}
}
fileFormatVersion: 2
guid: 7001b42f9e2553a4cb28935d34b516be
timeCreated: 1503640044
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System;
using System.Collections;
using UnityEngine;
public class Jesus : MotionNote
{
private static Sprite image = LoadNewSprite("Assets/MotionNotes/JP.png");
public override Sprite Image
{
get
{
return image;
}
}
public Jesus(string key, float timing) : this(timing)
{
}
public Jesus(float timing) : base(timing)
{
}
public override void Checkpoint()
{
IsChecked = true;
}
public override bool FinalJudgeAction()
{
return (InputManager.Instance.CurrentMotionState
& MotionState.JESUS) != 0;
}
}
fileFormatVersion: 2
guid: 15c3b7e2e4c349745a04b348f255f6ca
timeCreated: 1503640038
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -18,9 +18,14 @@ public class Jump : MotionNote
}
public Jump(float timing) : base(timing)
{
downCount = 0;
}
<<<<<<< HEAD
public override void Checkpoint()
{
IsChecked = (InputManager.Instance.CurrentMotionState
& MotionState.JUMP_PREPARE) != 0;
=======
private bool isChecked = false;
public override bool IsChecked
{
......@@ -54,14 +59,12 @@ public class Jump : MotionNote
Activated = true;
yield break;
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
}
public override bool FinalJudgeAction()
{
float currentSpineHeight
= InputManager.Instance
.Joints[Windows.Kinect.JointType.SpineBase].Position.Y;
return currentSpineHeight >= spineHeight;
return (InputManager.Instance.CurrentMotionState
& MotionState.JUMP_DONE) != 0;
}
}
using System;
using System.Collections;
using UnityEngine;
public class OnTheTable : MotionNote
{
private static Sprite image = LoadNewSprite("Assets/MotionNotes/JP.png");
public override Sprite Image
{
get
{
return image;
}
}
public OnTheTable(string key, float timing) : this(timing)
{
}
public OnTheTable(float timing) : base(timing)
{
}
public override void Checkpoint()
{
IsChecked = true;
}
public override bool FinalJudgeAction()
{
return (InputManager.Instance.CurrentMotionState
& MotionState.ON_THE_TABLE) != 0;
}
}
fileFormatVersion: 2
guid: 03af2790100c5024185b0a02a2c81490
timeCreated: 1503640053
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -7,7 +7,9 @@ public class PushUp : MotionNote
enum Hand { Both, Left, Right }
Hand hand;
private static Sprite image = LoadNewSprite("");
MotionState prepare, done;
private static Sprite image;
public override Sprite Image
{
get
......@@ -22,12 +24,21 @@ public class PushUp : MotionNote
{
case "BP":
hand = Hand.Both;
image = LoadNewSprite("BP");
prepare = MotionState.HAND_MOVE_UP_LEFT | MotionState.HAND_MOVE_UP_RIGHT;
done = MotionState.HAND_MOVE_DOWN_LEFT | MotionState.HAND_MOVE_DOWN_RIGHT;
break;
case "LP":
hand = Hand.Left;
image = LoadNewSprite("LP");
prepare = MotionState.HAND_MOVE_UP_LEFT;
done = MotionState.HAND_MOVE_DOWN_LEFT;
break;
case "RP":
hand = Hand.Right;
image = LoadNewSprite("RP");
prepare = MotionState.HAND_MOVE_UP_RIGHT;
done = MotionState.HAND_MOVE_DOWN_RIGHT;
break;
}
}
......@@ -35,6 +46,9 @@ public class PushUp : MotionNote
{
}
<<<<<<< HEAD
public override void Checkpoint()
=======
private bool isChecked = false;
public override bool IsChecked
{
......@@ -45,20 +59,15 @@ public class PushUp : MotionNote
}
public override IEnumerator Checkpoint(MotionNote obj)
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
while (motion != MotionState.CLAP_PREPARE)
yield return false;
Activated = true;
yield break;
IsChecked = (InputManager.Instance.CurrentMotionState
& prepare) != 0;
}
public override bool FinalJudgeAction()
{
throw new NotImplementedException();
return (InputManager.Instance.CurrentMotionState
& done) != 0;
}
}
......@@ -24,6 +24,40 @@ public abstract class MotionNote : Note
= new Dictionary<string, Type>
{
{ "CP", typeof(Clap) },
<<<<<<< HEAD
{ "JP", typeof(Jump) },
{ "BP", typeof(PushUp) },
{ "LP", typeof(PushUp) },
{ "RP", typeof(PushUp) },
{ "BK", typeof(PushUp) },
{ "LK", typeof(PushUp) },
{ "RK", typeof(PushUp) },
{ "BG", typeof(Guard) },
{ "LG", typeof(Guard) },
{ "RG", typeof(Guard) },
// Long motion
{ "BU", typeof(HandUp) },
{ "LU", typeof(HandUp) },
{ "RU", typeof(HandUp) },
{ "BD", typeof(HandDown) },
{ "LD", typeof(HandDown) },
{ "RD", typeof(HandDown) },
{ "JS", typeof(Jesus) },
{ "BH", typeof(Headphone) },
{ "LH", typeof(Headphone) },
{ "RH", typeof(Headphone) },
{ "OT", typeof(OnTheTable) },
=======
>>>>>>> 264d73d3155335b370d118cddd1ace963868a28c
};
protected static Sprite LoadNewSprite(string FilePath, float PixelsPerUnit = 100.0f)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment