Пример #1
0
        private void OnEnable()
        {
            button = serializedObject.targetObject as KGUI_Button;

            if (ButtonType == null)
            {
                ButtonType = new KGUIButtonTypeEditor();
            }

            if (ButtonEvent == null)
            {
                ButtonEvent = new KGUIButtonEventEditor();
            }

            if (ButtonAudio == null)
            {
                ButtonAudio = new KGUIButtonAudioEditor();
            }


            ButtonType.OnInstantiation(serializedObject);
            ButtonEvent.OnInstantiation(serializedObject);
            ButtonAudio.OnInstantiation(serializedObject);

            onGroupReset = serializedObject.FindProperty("onGroupReset");

            buttonGroup = serializedObject.FindProperty("buttonGroup");
        }
Пример #2
0
        public void RemoveButton(KGUI_Button button)
        {
            if (!Interactions.Contains(button))
            {
                return;
            }

            Interactions.Remove(button);
        }
Пример #3
0
        public void SetButton(KGUI_Button button)
        {
            if (Interactions == null)
            {
                return;
            }

            if (Interactions.Contains(button))
            {
                button.OnClick(0);
            }
        }
Пример #4
0
        public void AddButton(KGUI_Button button)
        {
            OnInitialize();

            if (Interactions.Contains(button))
            {
                return;
            }

            if (!button.IsButtonGroup)
            {
                return;
            }

            if (button.buttonGroup == null)
            {
                button.buttonGroup = this;
            }

            Interactions.Add(button);
        }