コード例 #1
0
 void set_default_button()
 {
     if (TBButton != null)
     {
         TBButton.TexturePath = TB_ICON_MAN;
     }
     if (ALButton != null)
     {
         ALButton.SetTexture(textureMan);
     }
 }
コード例 #2
0
 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();
     }
 }