Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            if (!m_Init)
            {
                m_Init = true;

                // We need to update in here as editor styles may not be available in OnEnable.
                UpdateArgumentsPreview();
            }

            serializedObject.Update();

            var height = m_StringReferenceDrawer.GetPropertyHeight(m_StringReference, s_StringReference);
            var rect   = EditorGUILayout.GetControlRect(true, height);

            m_StringReferenceDrawer.OnGUI(rect, m_StringReference, s_StringReference);

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(m_FormatArguments);
            if (EditorGUI.EndChangeCheck())
            {
                UpdateArgumentsPreview();
            }

            EditorGUILayout.PropertyField(m_UpdateString);
            serializedObject.ApplyModifiedProperties();
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            var height = m_StringReferenceDrawer.GetPropertyHeight(m_StringReference, s_StringReference);
            var rect   = EditorGUILayout.GetControlRect(true, height);

            m_StringReferenceDrawer.OnGUI(rect, m_StringReference, s_StringReference);

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.PropertyField(m_FormatArguments);
            if (EditorGUI.EndChangeCheck())
            {
                UpdateArgumentsPreview();
            }

            EditorGUILayout.PropertyField(m_UpdateString);
            serializedObject.ApplyModifiedProperties();
        }