void Beat() { if (FloatCloseToEqual(GetSpotlightVib(), dim, .01f)) { if (waitBeats >= panelController.WaitBeats) { spotlightColor = SetVValue(OriginalColor, bright); spotlightMat.SetColor("_EmissionColor", spotlightColor); spotlightIMat.SetColor("_EmissionColor", spotlightColor); waitBeats = 0; PanelRep.TurnOff(); } else { waitBeats++; } } else if (FloatCloseToEqual(GetSpotlightVib(), bright, .01f)) { spotlightColor = SetVValue(OriginalColor, 0); spotlightMat.SetColor("_EmissionColor", spotlightColor); spotlightIMat.SetColor("_EmissionColor", spotlightColor); if (CheckForPlayer()) { panelController.Hit(); } else { panelController.Miss(); } } }