mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 13:27:40 +02:00
Background Color Change Parity (#530)
* coin toss to see saw * all done * more stuffs
This commit is contained in:
@ -203,6 +203,27 @@ namespace HeavenStudio.Games
|
||||
UpdateColors();
|
||||
}
|
||||
|
||||
private void PersistColors(double beat)
|
||||
{
|
||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("builtToScaleDS", new string[] { "color" }).FindAll(x => x.beat < beat);
|
||||
if (allEventsBeforeBeat.Count > 0)
|
||||
{
|
||||
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat));
|
||||
var lastEvent = allEventsBeforeBeat[^1];
|
||||
UpdateMappingColors(lastEvent["object"], lastEvent["shooter"], lastEvent["bg"]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
PersistColors(beat);
|
||||
}
|
||||
|
||||
public override void OnPlay(double beat)
|
||||
{
|
||||
PersistColors(beat);
|
||||
}
|
||||
|
||||
private void UpdateColors()
|
||||
{
|
||||
objectMaterial.SetColor("_Color", currentObjectColor);
|
||||
|
Reference in New Issue
Block a user