/// <summary> /// Play the selected feedback /// </summary> void PlayFeedback(int id) { SerializedProperty property = _mmfeedbacks.GetArrayElementAtIndex(id); MMFeedback feedback = property.objectReferenceValue as MMFeedback; feedback.Play(feedback.transform.position); }
/// <summary> /// Play the selected feedback /// </summary> protected virtual void PlayFeedback(int id) { SerializedProperty property = _mmfeedbacks.GetArrayElementAtIndex(id); MMFeedback feedback = property.objectReferenceValue as MMFeedback; feedback.Play(feedback.transform.position, _targetMMFeedbacks.FeedbacksIntensity); }
private void GameOverCheck(int points) { if (points < 0) { OnGameOverfeedback.Play(Vector3.zero); } }
private void StageCheck(int points) { if (PointsPercentage < 1) { return; } actualStage++; MaxStagePoints *= 1.5f; TotalPoints = 0; KeyGenerator.Speed = KeyGenerator.Speed * 1.1f; OnStageUpfeedback.Play(Vector3.zero); OnStateChange?.Invoke(actualStage); }
public void Hitted(HitKey hitKey, SwipeType type) { if (hitKey.Type != type) { Missed(MissType.WrongDirection); } else { TotalPoints += hitKey.points; OnPointsChanged?.Invoke(TotalPoints); OnHit?.Invoke(PointsPercentage); OnHitfeedback?.Play(Vector3.zero); } }
public void Missed(MissType type) { if (type == MissType.NoObject) { TotalPoints -= 5; } else if (type == MissType.WrongDirection) { TotalPoints -= 10; } OnPointsChanged?.Invoke(TotalPoints); OnMissed?.Invoke(type, PointsPercentage); OnMissfeedback?.Play(Vector3.zero); }