Beispiel #1
0
        public void Initialize(AppBar newParentToolBar, AppBar.ButtonTemplate newTemplate, ButtonIconProfile newCustomProfile)
        {
            // TODO move this into the tag manager
            VisibleFilterTag     = new FilterTag();
            VisibleFilterTag.Tag = "Default";
            HiddenFilterTag      = new FilterTag();
            HiddenFilterTag.Tag  = "Hidden";

            template          = newTemplate;
            customIconProfile = newCustomProfile;
            parentToolBar     = newParentToolBar;

            cButton = GetComponent <CompoundButton>();
            cButton.MainRenderer.enabled = false;
            text      = GetComponent <CompoundButtonText>();
            text.Text = template.Text;
            icon      = GetComponent <CompoundButtonIcon>();
            if (customIconProfile != null)
            {
                icon.IconProfile = customIconProfile;
                icon.IconName    = string.Empty;
            }
            icon.IconName = template.Icon;
            initialized   = true;
            Hide();
        }
Beispiel #2
0
        public void Initialize(AppBar newParentToolBar, AppBar.ButtonTemplate newTemplate, ButtonIconProfile newCustomProfile)
        {
            // TODO move this into the tag manager
            VisibleFilterTag     = new FilterTag();
            VisibleFilterTag.Tag = "Default";
            HiddenFilterTag      = new FilterTag();
            HiddenFilterTag.Tag  = "Hidden";

            template          = newTemplate;
            customIconProfile = newCustomProfile;
            parentToolBar     = newParentToolBar;

            cButton = GetComponent <CompoundButton>();
            cButton.MainRenderer.enabled = false;
            text      = GetComponent <CompoundButtonText>();
            text.Text = template.Text;
            icon      = GetComponent <CompoundButtonIcon>();
            if (customIconProfile != null)
            {
                icon.Profile  = customIconProfile;
                icon.IconName = string.Empty;
            }
            icon.IconName = template.Icon;
            initialized   = true;
            Hide();

            if (newTemplate.EventTarget != null)
            {
                // Register the button with its target interactable
                newTemplate.EventTarget.RegisterInteractible(gameObject);
            }
            else
            {
                // Register the button with the parent app bar
                newParentToolBar.RegisterInteractible(gameObject);
            }
        }