private void ToggleLightsUI(int state) { lightsImage.color = state == 0 ? initColor : enabledColor; switch (state) { case 0: lightsImage.sprite = lightsStateSprites[0]; break; case 1: lightsImage.sprite = lightsStateSprites[0]; break; case 2: lightsImage.sprite = lightsStateSprites[1]; break; default: Debug.Log("Lights state out of range!!!"); break; } if (dash == null) { dash = FindObjectOfType <DashUIComponent>(); } dash?.SetDashLightsUI(lightsImage.color, lightsImage.sprite); }
private void ToggleLightsUI(int state) { lightsImage.color = state == 0 ? initColor : enabledColor; switch (state) { case 0: lightsImage.sprite = lightsStateSprites[0]; break; case 1: lightsImage.sprite = lightsStateSprites[0]; break; case 2: lightsImage.sprite = lightsStateSprites[1]; break; default: Debug.Log("Lights state out of range!!!"); break; } dash?.SetDashLightsUI(lightsImage.color, lightsImage.sprite); }