Class BeatmapUtil
Utility code for getting/deriving Beatmap properties.
Assembly: MouseDance.Runtime.dll
Syntax
public static class BeatmapUtil
Fields
MEDIUM_HIT_SCORE
Amount of score given if the player pressed a hit object within the 100 score hit-window.
Declaration
public const int MEDIUM_HIT_SCORE = 100
Field Value
PERFECT_HIT_SCORE
Amount of score given if the player pressed a hit object within the 300 score hit-window.
Declaration
public const int PERFECT_HIT_SCORE = 300
Field Value
SMALLEST_HIT_SCORE
Amount of score given if the player pressed a hit object within the 50 score hit-window.
Declaration
public const int SMALLEST_HIT_SCORE = 50
Field Value
Methods
DebugLog(Beatmap)
Outputs properties of the Beatmap into the Unity console window.
Use this for a quick test to see if your .osu file loaded correctly.
Declaration
public static void DebugLog(this Beatmap beatmap)
Parameters
Type |
Name |
Description |
OsuParsers.Beatmaps.Beatmap |
beatmap |
Beatmap that you want to Debug Log
|
GetCircleRadius(Single)
Get Radius of Hit Circles and Sliders given the Beatmap's Circle Size.
Declaration
public static float GetCircleRadius(float circleSize)
Parameters
Type |
Name |
Description |
Single |
circleSize |
0 to 10 value range
|
Returns
GetFadeInDuration(Beatmap)
For hit objects, this is the amount of time (in milliseconds) it fades in.
After this duration, the hit object should be showing at 100% opacity.
Formula comes from official docs on Approach rate.
Declaration
public static float GetFadeInDuration(this Beatmap beatmap)
Parameters
Type |
Name |
Description |
OsuParsers.Beatmaps.Beatmap |
beatmap |
|
Returns
GetFullOpacityDuration(Beatmap)
For hit objects, this is the amount of time (in milliseconds) the hit object stays at 100% opacity.
Formula comes from official docs on Approach rate.
Declaration
public static float GetFullOpacityDuration(this Beatmap beatmap)
Parameters
Type |
Name |
Description |
OsuParsers.Beatmaps.Beatmap |
beatmap |
|
Returns
GetHitWindows(Beatmap)
Time windows (in milliseconds) for getting score 50, 100, and 300 score.
Higher scores have shorter time windows.
This is affected by the Beatmap's Overall difficulty.
Declaration
public static (float, float, float) GetHitWindows(this Beatmap beatmap)
Parameters
Type |
Name |
Description |
OsuParsers.Beatmaps.Beatmap |
beatmap |
Beatmap to get the Overall difficulty from.
|
Returns
GetPreemptDuration(Beatmap)
For hit objects, this is the total duration (in milliseconds) that it appears,
starting from the time it fades in, until it is time to hit it.
Formula comes from official docs on Approach rate.
Declaration
public static float GetPreemptDuration(this Beatmap beatmap)
Parameters
Type |
Name |
Description |
OsuParsers.Beatmaps.Beatmap |
beatmap |
|
Returns
GetPreemptDuration(Single)
For hit objects, this is the total duration (in milliseconds) that it appears,
starting from the time it fades in, until it is time to hit it.
Formula comes from official docs on Approach rate.
Declaration
public static float GetPreemptDuration(float approachRate)
Parameters
Type |
Name |
Description |
Single |
approachRate |
|
Returns
GetSliderBaseScore(Int32, Int32)
Declaration
public static int GetSliderBaseScore(int collected, int total)
Parameters
Returns