private void Load(object data, int[] trackIndexes)
{
try
{
_trackIndexes = trackIndexes;
if (Std.InstanceOf<ArrayBuffer>(data))
{
ScoreLoaded(ScoreLoader.LoadScoreFromBytes(Std.ArrayBufferToByteArray((ArrayBuffer)data)));
}
else if (Std.InstanceOf<Uint8Array>(data))
{
ScoreLoaded(ScoreLoader.LoadScoreFromBytes((byte[])data));
}
else if (JsContext.JsTypeOf(data) == JsTypes.@string)
{
ScoreLoader.LoadScoreAsync((string)data, ScoreLoaded, Error);
}
}
catch (Exception e)
{
Error(e);
}
}