private PlayBandDirection Decide8Way(Vector2 forceDirection, float forceAngel) { PlayBandDirection directionWay = PlayBandDirection.Up; if (forceAngel <= 22.5f) { directionWay = PlayBandDirection.Up; } else if (forceAngel > 22.5f && forceAngel <= 67.5f) { directionWay = (forceDirection.x >= 0) ? PlayBandDirection.RightUp : PlayBandDirection.LeftUp; } else if (forceAngel > 67.5f && forceAngel <= 112.5f) { directionWay = (forceDirection.x >= 0) ? PlayBandDirection.Right : PlayBandDirection.Left; } else if (forceAngel > 112.5f && forceAngel <= 157.5f) { directionWay = (forceDirection.x >= 0) ? PlayBandDirection.RightDown : PlayBandDirection.LeftDown; } else if (forceAngel > 157.5f) { directionWay = PlayBandDirection.Down; } return(directionWay); }
// 4way void DisplayWay(PlayBandDirection dir, PlayBandData data) { int ptr = (int)dir; if (OpenCheck) { if (Time.time < nextTime) { switch (ptr) { case 1: ShakeWay = 1; break; case 2: ShakeWay = 2; break; case 3: ShakeWay = 3; break; case 4: ShakeWay = 4; break; case 5: ShakeWay = 5; break; case 6: ShakeWay = 6; break; case 7: ShakeWay = 7; break; case 8: ShakeWay = 8; break; } OpenCheck = false; CheckAnswer(); } } }
private PlayBandDirection Decide4Way(Vector2 forceDirection, float forceAngel) { PlayBandDirection directionWay = PlayBandDirection.Up; if (forceAngel <= 45f) { directionWay = PlayBandDirection.Up; } else if (forceAngel > 45f && forceAngel <= 135f) { directionWay = (forceDirection.x >= 0) ? PlayBandDirection.Right : PlayBandDirection.Left; } else if (forceAngel > 135f) { directionWay = PlayBandDirection.Down; } return(directionWay); }
private PlayBandDirection DecideZWay(Vector2 forceDirection) { PlayBandDirection directionWay = (forceDirection.x >= 0) ? PlayBandDirection.Forward : PlayBandDirection.Back; return(directionWay); }
private PlayBandDirection DecideYWay(Vector2 forceDirection) { PlayBandDirection directionWay = (forceDirection.y >= 0) ? PlayBandDirection.Up : PlayBandDirection.Down; return(directionWay); }
//-------------------------------------------------------------------- private PlayBandDirection DecideXWay(Vector2 forceDirection) { PlayBandDirection directionWay = (forceDirection.x >= 0) ? PlayBandDirection.Right : PlayBandDirection.Left; return(directionWay); }