public void OnButtonUp(TargetManagerInputType inputType) { SpriteRenderer sprite = GetMappedSprite(inputType); if(sprite != null) { Color color = sprite.color; color.a = alpha; sprite.color = color; } }
public SpriteRenderer GetMappedSprite(TargetManagerInputType inputType) { switch(inputType) { case TargetManagerInputType.Up: return upSprite; case TargetManagerInputType.Down: return downSprite; case TargetManagerInputType.Left: return leftSprite; case TargetManagerInputType.Right: return rightSprite; default: return null; } }
public void HandleInput(TargetManagerInputType inputType) { NoteType noteType = GetMappedNoteType(inputType); for(int i = 0; i < notes.Count; ++i) { Note currNote = notes[i]; if(currNote.Type == noteType) { caughtCount++; UpdateAccuracy (); notes.Remove(currNote); --i; currNote.gameObject.SetActive(false); } } }
public NoteType GetMappedNoteType(TargetManagerInputType inputType) { switch(inputType) { case TargetManagerInputType.Up: return NoteType.High; case TargetManagerInputType.Down: return NoteType.Low; case TargetManagerInputType.Left: return NoteType.MidLow; case TargetManagerInputType.Right: return NoteType.MidHigh; default: return NoteType.Undefined; } }