mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-15 03:35:18 -05:00
onUpdate, etc. works now too
This commit is contained in:
parent
606d9d4af4
commit
c83e505f5b
2 changed files with 13 additions and 1 deletions
|
@ -1178,12 +1178,16 @@ class PlayState extends MusicBeatSubState
|
|||
// Dispatch event to conversation script.
|
||||
ScriptEventDispatcher.callEvent(currentConversation, event);
|
||||
|
||||
// Dispatch event to note script
|
||||
// Dispatch event to only the specific note script
|
||||
if (Std.isOfType(event, NoteScriptEvent))
|
||||
{
|
||||
var noteEvent:NoteScriptEvent = cast(event, NoteScriptEvent);
|
||||
NoteKindManager.callEvent(noteEvent.note.noteData.kind, noteEvent);
|
||||
}
|
||||
else // Dispatch event to all note scripts
|
||||
{
|
||||
NoteKindManager.callEventForAll(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,4 +43,12 @@ class NoteKindManager
|
|||
|
||||
ScriptEventDispatcher.callEvent(noteKind, event);
|
||||
}
|
||||
|
||||
public static function callEventForAll(event:ScriptEvent):Void
|
||||
{
|
||||
for (noteKind in noteKinds.iterator())
|
||||
{
|
||||
ScriptEventDispatcher.callEvent(noteKind, event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue