예제 #1
0
    public override void EnableElement()
    {
        MainNavMapButton component = GetComponent <MainNavMapButton>();

        if (component != null)
        {
            component.enabled = true;
        }
        AccessibilitySettings component2 = GetComponent <AccessibilitySettings>();

        if (component2 != null)
        {
            component2.CustomToken = AccessibilityEnabledToken;
        }
        GetComponent <MainNavButton>().enabled = true;
        ButtonIcon.sprite   = GetComponent <MainNavButton>().NormalSprite;
        onPressedEventAdded = false;
        GetComponent <ButtonClickListener>().OnClick.RemoveListener(onPressed);
        ButtonText.text = Service.Get <Localizer>().GetTokenTranslation(MapToken);
    }
예제 #2
0
    public override void DisableElement(bool hide)
    {
        MainNavMapButton component = GetComponent <MainNavMapButton>();

        if (component != null)
        {
            component.enabled = false;
        }
        AccessibilitySettings component2 = GetComponent <AccessibilitySettings>();

        if (component2 != null)
        {
            component2.CustomToken = AccessibilityDisabledToken;
        }
        GetComponent <MainNavButton>().enabled = false;
        ButtonIcon.sprite = GetComponent <MainNavButton>().DisabledSprite;
        if (!onPressedEventAdded)
        {
            onPressedEventAdded = true;
            GetComponent <ButtonClickListener>().OnClick.AddListener(onPressed);
        }
        ButtonText.text = Service.Get <Localizer>().GetTokenTranslation(ExitToken);
    }