diff --git a/RhythmGameUtilities/Scripts/Audio.cs b/RhythmGameUtilities/Scripts/Audio.cs
index 185fa7c..ab72001 100644
--- a/RhythmGameUtilities/Scripts/Audio.cs
+++ b/RhythmGameUtilities/Scripts/Audio.cs
@@ -30,6 +30,13 @@ internal static class AudioInternal
public static class Audio
{
+ ///
+ /// Converts samples from an audio file into data used to display a waveform.
+ ///
+ ///
+ /// Array of sample data from an audio file.
+ /// Width of the waveform.
+ /// Height of the waveform.
public static int[][] ConvertSamplesToWaveform(float[] samples, int width, int height)
{
var ptr = AudioInternal.ConvertSamplesToWaveform(samples, samples.Length, width, height);
diff --git a/RhythmGameUtilities/Scripts/Common.cs b/RhythmGameUtilities/Scripts/Common.cs
index b5b48a4..f217cd1 100644
--- a/RhythmGameUtilities/Scripts/Common.cs
+++ b/RhythmGameUtilities/Scripts/Common.cs
@@ -29,11 +29,25 @@ public static class CommonInternal
public static class Common
{
+ ///
+ /// Calculates the linear interpolation between two values.
+ ///
+ ///
+ /// The start value.
+ /// The end value.
+ /// The value used for interpolation.
public static float Lerp(float a, float b, float t)
{
return CommonInternal.Lerp(a, b, t);
}
+ ///
+ /// Calculates the fraction, based on a value between two values.
+ ///
+ ///
+ /// The start value.
+ /// The end value.
+ /// The value in the middle.
public static float InverseLerp(float a, float b, float v)
{
return CommonInternal.InverseLerp(a, b, v);
diff --git a/RhythmGameUtilities/Scripts/Utilities.cs b/RhythmGameUtilities/Scripts/Utilities.cs
index 0831ce3..827072c 100644
--- a/RhythmGameUtilities/Scripts/Utilities.cs
+++ b/RhythmGameUtilities/Scripts/Utilities.cs
@@ -73,22 +73,47 @@ public static class Utilities
public const float SECONDS_PER_MINUTE = 60.0f;
+ ///
+ /// Convert a tick to a 2D/3D position.
+ ///
+ ///
+ /// The tick.
+ /// The resolution of the song.
public static float ConvertTickToPosition(float tick, int resolution)
{
return UtilitiesInternal.ConvertTickToPosition(tick, resolution);
}
+ ///
+ /// Convert seconds to ticks.
+ ///
+ ///
+ /// The seconds to generate ticks with.
+ /// The resolution of the song.
+ /// All BPM changes within the song.
public static int ConvertSecondsToTicks(float seconds, int resolution, Dictionary bpmChanges)
{
return UtilitiesInternal.ConvertSecondsToTicksInternal(seconds, resolution, bpmChanges.Keys.ToArray(),
bpmChanges.Values.ToArray(), bpmChanges.Count);
}
+ ///
+ /// Checks to see if the current time of a game or audio file is on the beat.
+ ///
+ ///
+ /// The base BPM for a song.
+ /// A timestamp to compare to the BPM.
public static bool IsOnTheBeat(float bpm, float currentTime)
{
return UtilitiesInternal.IsOnTheBeat(bpm, currentTime);
}
+ ///
+ /// Rounds a value up the nearest multiplier.
+ ///
+ ///
+ /// The value to round.
+ /// The multiplier to round using.
public static int RoundUpToTheNearestMultiplier(int value, int multiplier)
{
return UtilitiesInternal.RoundUpToTheNearestMultiplier(value, multiplier);
@@ -146,6 +171,13 @@ public static List CalculateBeatBars(Dictionary bpmChanges, i
return null;
}
+ ///
+ /// Calculated the accuracy ratio of the current position against a static position.
+ ///
+ ///
+ /// The position to test against.
+ /// The current position.
+ /// The plus/minus delta to test the current position against.
public static float CalculateAccuracyRatio(int position, int currentPosition, int delta = 50)
{
return UtilitiesInternal.CalculateAccuracyRatio(position, currentPosition, delta);
diff --git a/UnityPackage/Scripts/Audio.cs b/UnityPackage/Scripts/Audio.cs
index 185fa7c..ab72001 100644
--- a/UnityPackage/Scripts/Audio.cs
+++ b/UnityPackage/Scripts/Audio.cs
@@ -30,6 +30,13 @@ internal static class AudioInternal
public static class Audio
{
+ ///
+ /// Converts samples from an audio file into data used to display a waveform.
+ ///
+ ///
+ /// Array of sample data from an audio file.
+ /// Width of the waveform.
+ /// Height of the waveform.
public static int[][] ConvertSamplesToWaveform(float[] samples, int width, int height)
{
var ptr = AudioInternal.ConvertSamplesToWaveform(samples, samples.Length, width, height);
diff --git a/UnityPackage/Scripts/Common.cs b/UnityPackage/Scripts/Common.cs
index b5b48a4..f217cd1 100644
--- a/UnityPackage/Scripts/Common.cs
+++ b/UnityPackage/Scripts/Common.cs
@@ -29,11 +29,25 @@ public static class CommonInternal
public static class Common
{
+ ///
+ /// Calculates the linear interpolation between two values.
+ ///
+ ///
+ /// The start value.
+ /// The end value.
+ /// The value used for interpolation.
public static float Lerp(float a, float b, float t)
{
return CommonInternal.Lerp(a, b, t);
}
+ ///
+ /// Calculates the fraction, based on a value between two values.
+ ///
+ ///
+ /// The start value.
+ /// The end value.
+ /// The value in the middle.
public static float InverseLerp(float a, float b, float v)
{
return CommonInternal.InverseLerp(a, b, v);
diff --git a/UnityPackage/Scripts/Utilities.cs b/UnityPackage/Scripts/Utilities.cs
index 0831ce3..827072c 100644
--- a/UnityPackage/Scripts/Utilities.cs
+++ b/UnityPackage/Scripts/Utilities.cs
@@ -73,22 +73,47 @@ public static class Utilities
public const float SECONDS_PER_MINUTE = 60.0f;
+ ///
+ /// Convert a tick to a 2D/3D position.
+ ///
+ ///
+ /// The tick.
+ /// The resolution of the song.
public static float ConvertTickToPosition(float tick, int resolution)
{
return UtilitiesInternal.ConvertTickToPosition(tick, resolution);
}
+ ///
+ /// Convert seconds to ticks.
+ ///
+ ///
+ /// The seconds to generate ticks with.
+ /// The resolution of the song.
+ /// All BPM changes within the song.
public static int ConvertSecondsToTicks(float seconds, int resolution, Dictionary bpmChanges)
{
return UtilitiesInternal.ConvertSecondsToTicksInternal(seconds, resolution, bpmChanges.Keys.ToArray(),
bpmChanges.Values.ToArray(), bpmChanges.Count);
}
+ ///
+ /// Checks to see if the current time of a game or audio file is on the beat.
+ ///
+ ///
+ /// The base BPM for a song.
+ /// A timestamp to compare to the BPM.
public static bool IsOnTheBeat(float bpm, float currentTime)
{
return UtilitiesInternal.IsOnTheBeat(bpm, currentTime);
}
+ ///
+ /// Rounds a value up the nearest multiplier.
+ ///
+ ///
+ /// The value to round.
+ /// The multiplier to round using.
public static int RoundUpToTheNearestMultiplier(int value, int multiplier)
{
return UtilitiesInternal.RoundUpToTheNearestMultiplier(value, multiplier);
@@ -146,6 +171,13 @@ public static List CalculateBeatBars(Dictionary bpmChanges, i
return null;
}
+ ///
+ /// Calculated the accuracy ratio of the current position against a static position.
+ ///
+ ///
+ /// The position to test against.
+ /// The current position.
+ /// The plus/minus delta to test the current position against.
public static float CalculateAccuracyRatio(int position, int currentPosition, int delta = 50)
{
return UtilitiesInternal.CalculateAccuracyRatio(position, currentPosition, delta);