Skip to content

Commit

Permalink
Merge pull request #15 from homy-game-studio/add-scale-random
Browse files Browse the repository at this point in the history
feat(ToneScale): Add Random() method
  • Loading branch information
MatheusMoura17 authored Sep 2, 2022
2 parents 1527c67 + 3ed6312 commit e32f43f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/Package/Runtime/Scripts/Math/ToneScale.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public override string ToString()
ToneScale.MinorSeventh,
};

public static ToneScale Random()
{
var index = UnityEngine.Random.Range(0, _scales.Count);
return _scales[index];
}

public static ToneScale Parse(string content)
{
return _scales.Find(scale => scale.Code == content);
Expand Down

0 comments on commit e32f43f

Please sign in to comment.