Customize note instance in runtime
Last updated
Last updated
//For receiving call back from the TrackManager's (onNoteInit) event, when a note is being init
public void OnNoteInit(Note note)
{
var selectedColor = randomColors[Random.Range(0, randomColors.Count)];
//Loop through all the notes, then assign a random color to them
foreach (var renderer in note.GetComponentsInChildren<SpriteRenderer>())
{
if (renderer.name != "Swipe Indicator")
renderer.color = selectedColor.color;
}
//We appends the color name to the the note object, so we can recognize it back later on
note.name = selectedColor.name;
}