Commit c471ce93 authored by 16서원빈's avatar 16서원빈

Working on motion notes

parent 38fb1af7
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
public class Clap : MotionNote
......@@ -20,13 +20,13 @@ public class Clap : MotionNote
{
}
public override IEnumerable<bool> Checkpoint()
public override IEnumerator Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
while (motion != MotionState.CLAP_PREPARE)
yield return false;
yield return null;
Activated = true;
......
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
public class Guard : MotionNote
......@@ -16,7 +16,7 @@ public class Guard : MotionNote
}
}
public Guard(string key, float timing) : this(timing)
public Guard(string key, float timing, float end = 0f) : this(timing, end)
{
switch (key)
{
......@@ -31,11 +31,11 @@ public class Guard : MotionNote
break;
}
}
public Guard(float timing) : base(timing)
public Guard(float timing, float end = 0f) : base(timing, end)
{
}
public override IEnumerable<bool> Checkpoint()
public override IEnumerator Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
......
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
public class Jump : MotionNote
......@@ -20,7 +20,7 @@ public class Jump : MotionNote
{
}
public override IEnumerable<bool> Checkpoint()
public override IEnumerator Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
......
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
public class Piano : MotionNote
......@@ -35,7 +35,7 @@ public class Piano : MotionNote
{
}
public override IEnumerable<bool> Checkpoint()
public override IEnumerator Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
......
using System;
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
public class PushUp : MotionNote
......@@ -35,7 +35,7 @@ public class PushUp : MotionNote
{
}
public override IEnumerable<bool> Checkpoint()
public override IEnumerator Checkpoint()
{
var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState;
......
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
......@@ -12,28 +13,61 @@ public abstract class MotionNote : Note
public MotionNote(string key, float start, float end = 0f)
: this(start, end) { }
public abstract IEnumerable<bool> Checkpoint();
public abstract IEnumerator Checkpoint();
public static readonly Dictionary<string, Type> keymap
= new Dictionary<string, Type>
{
{ "CP", typeof(Clap) },
{ "JP", typeof(Jump) },
{ "BP", typeof(PushUp) },
{ "LP", typeof(PushUp) },
{ "RP", typeof(PushUp) },
{ "BK", typeof(PushUp) },
{ "LK", typeof(PushUp) },
{ "RK", typeof(PushUp) },
{ "BI", typeof(Piano) },
{ "LI", typeof(Piano) },
{ "RI", typeof(Piano) },
{ "BG", typeof(Guard) },
{ "LG", typeof(Guard) },
{ "RG", typeof(Guard) },
{ "BL", typeof(Guard) },
{ "LL", typeof(Guard) },
{ "RL", typeof(Guard) },
// Long motion
{ "BU", typeof(Guard) },
{ "LU", typeof(Guard) },
{ "RU", typeof(Guard) },
{ "BD", typeof(Guard) },
{ "LD", typeof(Guard) },
{ "RD", typeof(Guard) },
{ "JS", typeof(Guard) },
{ "BH", typeof(Guard) },
{ "LH", typeof(Guard) },
{ "RH", typeof(Guard) },
{ "OT", typeof(Guard) },
};
protected static Sprite LoadNewSprite(string FilePath, float PixelsPerUnit = 100.0f)
{
Sprite NewSprite = new Sprite();
Texture2D SpriteTexture = LoadTexture(FilePath);
if (SpriteTexture == null)
return null;
NewSprite = Sprite.Create(SpriteTexture,
new Rect(0, 0, SpriteTexture.width, SpriteTexture.height),
new Vector2(0, 0), PixelsPerUnit);
......
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