private void ToggleWiperUI(int state) { wiperImage.color = state == 0 ? initColor : enabledColor; switch (state) { case 0: wiperImage.sprite = wiperStateSprites[0]; break; case 1: wiperImage.sprite = wiperStateSprites[1]; break; case 2: wiperImage.sprite = wiperStateSprites[2]; break; case 3: wiperImage.sprite = wiperStateSprites[3]; break; default: Debug.Log("Wiper state out of range!!!"); break; } dash?.SetDashWiperUI(wiperImage.color, wiperImage.sprite); }
private void ToggleWiperUI(int state) { wiperImage.color = state == 0 ? initColor : enabledColor; switch (state) { case 0: wiperImage.sprite = wiperStateSprites[0]; break; case 1: wiperImage.sprite = wiperStateSprites[1]; break; case 2: wiperImage.sprite = wiperStateSprites[2]; break; case 3: wiperImage.sprite = wiperStateSprites[3]; break; default: Debug.Log("Wiper state out of range!!!"); break; } if (dash == null) { dash = FindObjectOfType <DashUIComponent>(); } dash?.SetDashWiperUI(wiperImage.color, wiperImage.sprite); }