correctly colour SymbolButton by button state, independently of event order
This commit is contained in:
@@ -24,14 +24,16 @@ namespace EscapeRoomEngine.Desert.Runtime.Puzzle_A
|
||||
{
|
||||
base.Start();
|
||||
|
||||
ButtonEvent += (_, type) =>
|
||||
ButtonEvent += (_, _) =>
|
||||
{
|
||||
var color = type switch
|
||||
var color = theme.puzzleColor;
|
||||
if (!Active)
|
||||
{
|
||||
ButtonEventType.Pressed => theme.activeColor,
|
||||
ButtonEventType.Deactivated => theme.solvedColor,
|
||||
_ => theme.puzzleColor
|
||||
};
|
||||
color = theme.solvedColor;
|
||||
} else if (Pressed)
|
||||
{
|
||||
color = theme.activeColor;
|
||||
}
|
||||
|
||||
_material.SetColor(FresnelColor, color);
|
||||
_material.SetColor(Color, color);
|
||||
|
||||
Reference in New Issue
Block a user