void set_default_button() { if (TBButton != null) { TBButton.TexturePath = TB_ICON_MAN; } if (ALButton != null) { ALButton.SetTexture(textureMan); } }
void Update() { if (TCA != null) { if (TBButton != null) { if (TCA.IsStateSet(TCAState.Enabled)) { TBButton.TexturePath = TCA.IsStateSet(TCAState.HaveEC) ? TB_ICON_ON : TB_ICON_NC; } else { TBButton.TexturePath = TB_ICON_OFF; } } if (ALButton != null) { if (TCA.IsStateSet(TCAState.Enabled)) { ALButton.SetTexture(TCA.IsStateSet(TCAState.HaveEC) ? textureOn : textureNoCharge); } else { ALButton.SetTexture(textureOff); } } } else if (HighLogic.LoadedSceneIsEditor && TCAGuiEditor.Available) { if (TBButton != null) { TBButton.TexturePath = TB_ICON_ON; } if (ALButton != null) { ALButton.SetTexture(textureOn); } } else { set_default_button(); } }