示例#1
0
    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);
    }
示例#2
0
    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);
    }
示例#3
0
 private void ToggleParkingBrakeUI(int state)
 {
     parkingBrakeImage.color = Convert.ToBoolean(state) ? enabledColor : initColor;
     if (dash == null)
     {
         dash = FindObjectOfType <DashUIComponent>();
     }
     dash?.SetDashParkingBrakeUI(parkingBrakeImage.color);
 }
示例#4
0
 private void ToggleIgnitionUI(int state)
 {
     ignitionImage.color = Convert.ToBoolean(state) ? enabledColor : initColor;
     if (dash == null)
     {
         dash = FindObjectOfType <DashUIComponent>();
     }
     dash?.SetDashIgnitionUI(ignitionImage.color);
 }
示例#5
0
 private void ToggleShiftUI(int state)
 {
     shiftImage.color  = Convert.ToBoolean(state) ? enabledColor : disabledColor;
     shiftImage.sprite = Convert.ToBoolean(state) ? shiftStateSprites[0] : shiftStateSprites[1];
     if (dash == null)
     {
         dash = FindObjectOfType <DashUIComponent>();
     }
     dash?.SetDashShiftUI(shiftImage.color, shiftImage.sprite);
 }
示例#6
0
 private void OnEnable()
 {
     Missive.AddListener <DashStateMissive>(OnDashStateChange);
     dash = FindObjectOfType <DashUIComponent>();
 }
示例#7
0
 private void OnDisable()
 {
     Missive.RemoveListener <DashStateMissive>(OnDashStateChange);
     dash = null;
 }