Example #1
0
        private void OnEnable()
        {
            toggle = serializedObject.targetObject as KGUI_Toggle;

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

            buttonAudio.OnInstantiation(serializedObject);

            OnValueChanged = serializedObject.FindProperty("OnValueChanged");

            spriteRenderer = serializedObject.FindProperty("spriteRenderer");
            image          = serializedObject.FindProperty("image");

            onNormalSprite  = serializedObject.FindProperty("onNormalSprite");
            offNormalSprite = serializedObject.FindProperty("offNormalSprite");

            onEnterSprite  = serializedObject.FindProperty("onEnterSprite");
            offEnterSprite = serializedObject.FindProperty("offEnterSprite");

            onNormalObject  = serializedObject.FindProperty("onNormalObject");
            offNormalObject = serializedObject.FindProperty("offNormalObject");

            onEnterObject  = serializedObject.FindProperty("onEnterObject");
            offEnterObject = serializedObject.FindProperty("offEnterObject");
        }
        private void OnEnable()
        {
            toggle = serializedObject.targetObject as KGUI_Toggle;

            OnValueChanged = serializedObject.FindProperty("OnValueChanged");

            spriteRenderer = serializedObject.FindProperty("spriteRenderer");
            image          = serializedObject.FindProperty("image");

            onNormalSprite  = serializedObject.FindProperty("onNormalSprite");
            offNormalSprite = serializedObject.FindProperty("offNormalSprite");

            onEnterSprite  = serializedObject.FindProperty("onEnterSprite");
            offEnterSprite = serializedObject.FindProperty("offEnterSprite");

            onNormalObject  = serializedObject.FindProperty("onNormalObject");
            offNormalObject = serializedObject.FindProperty("offNormalObject");

            onEnterObject  = serializedObject.FindProperty("onEnterObject");
            offEnterObject = serializedObject.FindProperty("offEnterObject");

            AudioClip = serializedObject.FindProperty("audioClip");
        }