public void SwitchState() { if (buttonState.GetState() == LaserColor.blue) { buttonState.SetState(LaserColor.yellow); } else if (buttonState.GetState() == LaserColor.yellow) { buttonState.SetState(LaserColor.blue); } }
public void UpdateSprite() { switch (buttonState.GetState()) { case LaserColor.blue: spriteRenderer.sprite = BlueSprite; break; case LaserColor.yellow: spriteRenderer.sprite = YellowSprite; break; default: break; } }
private void Update() { // This shouldn't be being run every frame, but it's here until a better solution comes along. LaserEnable(buttonState.GetState() == laserGateColor.GetLaserColor()); }