Exemple #1
0
 /// <summary>
 /// Raises the enable event.
 /// </summary>
 protected override void OnEnable()
 {
     base.OnEnable();
     m_LinkKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                    HyperTextProcessorDrawer.OnDrawLinkKeywordCollectionsEntry(
         position, index, m_TextProcessor, () => m_AssignedCollections
         );
     m_QuadKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                    HyperTextProcessorDrawer.OnDrawQuadKeywordCollectionsEntry(
         position, index, m_TextProcessor, () => m_AssignedCollections
         );
     m_TagKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                   HyperTextProcessorDrawer.OnDrawTagKeywordCollectionsEntry(
         position, index, m_TextProcessor, () => m_AssignedCollections
         );
     SerializedPropertyX.GetRemainingVisibleProperties <HyperText>(
         this.target as HyperText, m_SubclassProperties
         );
     UpdateGUIContents();
 }
Exemple #2
0
        /// <summary>
        /// Raises the enable event.
        /// </summary>
        new private void OnEnable()
        {
            base.OnEnable();
            m_InteractableProperty       = this.serializedObject.FindProperty("m_Interactable");
            m_ColorProperty              = this.serializedObject.FindProperty("m_Color");
            m_FontDataProperty           = this.serializedObject.FindProperty("m_FontData");
            m_FontProperty               = m_FontDataProperty.FindPropertyRelative("m_Font");
            m_FontStyleProperty          = m_FontDataProperty.FindPropertyRelative("m_FontStyle");
            m_FontSizeProperty           = m_FontDataProperty.FindPropertyRelative("m_FontSize");
            m_LineSpacingProperty        = m_FontDataProperty.FindPropertyRelative("m_LineSpacing");
            m_RichTextProperty           = m_FontDataProperty.FindPropertyRelative("m_RichText");
            m_AlignmentProperty          = m_FontDataProperty.FindPropertyRelative("m_Alignment");
            m_HorizontalOverflowProperty = m_FontDataProperty.FindPropertyRelative("m_HorizontalOverflow");
            m_VerticalOverflowProperty   = m_FontDataProperty.FindPropertyRelative("m_VerticalOverflow");
            m_BestFitProperty            = m_FontDataProperty.FindPropertyRelative("m_BestFit");
            m_LinkHitboxPaddingProperty  = this.serializedObject.FindProperty("m_LinkHitboxPadding");
            m_MaterialProperty           = this.serializedObject.FindProperty("m_Material");
            m_OnClickProperty            = this.serializedObject.FindProperty("m_OnClick");
            m_OnEnterProperty            = this.serializedObject.FindProperty("m_OnEnter");
            m_OnExitProperty             = this.serializedObject.FindProperty("m_OnExit");
            m_OnPressProperty            = this.serializedObject.FindProperty("m_OnPress");
            m_OnReleaseProperty          = this.serializedObject.FindProperty("m_OnRelease");
            m_OverrideFontColorProperty  = this.serializedObject.FindProperty("m_ShouldOverrideStylesFontColor");
            m_OverrideFontStyleProperty  = this.serializedObject.FindProperty("m_ShouldOverrideStylesFontStyle");
            m_OverrideFontSizeProperty   =
                this.serializedObject.FindProperty("m_TextProcessor.m_ShouldOverrideStylesFontSize");
            m_OverrideLineSpacingProperty = this.serializedObject.FindProperty("m_ShouldOverrideStylesLineSpacing");
            m_OverrideLinkHitboxProperty  =
                this.serializedObject.FindProperty("m_ShouldOverrideStylesLinkHitboxPadding");
            m_ScriptProperty          = this.serializedObject.FindProperty("m_Script");
            m_StylesProperty          = this.serializedObject.FindProperty("m_TextProcessor.m_Styles");
            m_TextProperty            = this.serializedObject.FindProperty("m_Text");
            m_TextProcessorProperty   = this.serializedObject.FindProperty("m_TextProcessor");
            m_InputTextSourceProperty = this.serializedObject.FindProperty("m_TextProcessor.m_InputTextSourceObject");
            m_LinkKeywordCollections  = new ReorderableList(
                this.serializedObject, this.serializedObject.FindProperty("m_TextProcessor.m_LinkKeywordCollections")
                );
            string displayName1 = m_LinkKeywordCollections.serializedProperty.displayName;

            m_LinkKeywordCollections.drawHeaderCallback  = (position) => EditorGUI.LabelField(position, displayName1);
            m_LinkKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                           HyperTextProcessorDrawer.OnDrawLinkKeywordCollectionsEntry(
                position, index, m_TextProcessorProperty, () => m_AssignedCollections
                );
            m_QuadKeywordCollections = new ReorderableList(
                this.serializedObject, this.serializedObject.FindProperty("m_TextProcessor.m_QuadKeywordCollections")
                );
            string displayName2 = m_QuadKeywordCollections.serializedProperty.displayName;

            m_QuadKeywordCollections.drawHeaderCallback  = (position) => EditorGUI.LabelField(position, displayName2);
            m_QuadKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                           HyperTextProcessorDrawer.OnDrawQuadKeywordCollectionsEntry(
                position, index, m_TextProcessorProperty, () => m_AssignedCollections
                );
            m_TagKeywordCollections = new ReorderableList(
                this.serializedObject, this.serializedObject.FindProperty("m_TextProcessor.m_TagKeywordCollections")
                );
            string displayName3 = m_TagKeywordCollections.serializedProperty.displayName;

            m_TagKeywordCollections.drawHeaderCallback  = (position) => EditorGUI.LabelField(position, displayName3);
            m_TagKeywordCollections.drawElementCallback = (position, index, isActive, isFocused) =>
                                                          HyperTextProcessorDrawer.OnDrawTagKeywordCollectionsEntry(
                position, index, m_TextProcessorProperty, () => m_AssignedCollections
                );
        }