示例#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);
        }