private void LayoutRemoteNotifications()
        {
            m_showRemoteNotifications = UnityEditorUtility.DrawPropertyHeader(m_showRemoteNotifications, m_remoteNotificationsGUIContent);

            if (m_showRemoteNotifications)
            {
                DrawReceivedNotifications(NotificationCenter.RemoteNotifications, (_selectedNotification) => {
                    if (_selectedNotification != null)
                    {
                        NotificationCenter.OnTappingRemoteNotification(_selectedNotification);
                    }
                });
            }
        }
        private bool DrawSerializedProperty(SerializedProperty _property)
        {
            if (_property == null)
            {
                return(false);
            }

            // Draw header
            bool _isSelected = UnityEditorUtility.DrawPropertyHeader(_property);

            // Draw immediate childrens
            if (_property.hasVisibleChildren && _property.isExpanded)
            {
                SerializedProperty _propertyCopy = _property.Copy();
                SerializedProperty _endProperty  = _property.GetEndProperty();

                // Move to immediate child property
                _propertyCopy.NextVisible(true);

                GUILayout.Space(-4f);
                GUILayout.BeginHorizontal("HelpBox");
                {
                    GUILayout.Space(8f);
                    GUILayout.BeginVertical();
                    {
                        do
                        {
                            if (SerializedProperty.EqualContents(_propertyCopy, _endProperty))
                            {
                                break;
                            }

                            // Lets make all properties expanded
                            _propertyCopy.isExpanded = true;

                            EditorGUILayout.PropertyField(_propertyCopy, true);
                        }while (_propertyCopy.NextVisible(false));
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndHorizontal();
            }

            return(_isSelected);
        }
Exemplo n.º 3
0
        private bool DrawSerializedProperty(SerializedProperty _property)
        {
            if (_property == null || !_property.hasVisibleChildren)
            {
                return(false);
            }

            bool _isSelected = UnityEditorUtility.DrawPropertyHeader(_property);

            if (_property.hasVisibleChildren && _property.isExpanded)
            {
                GUILayout.Space(-4f);
                GUILayout.BeginHorizontal("HelpBox");
                {
                    GUILayout.Space(8f);
                    GUILayout.BeginVertical();
                    {
                        UnityEditorUtility.ForEach(_property, (_childrenProperty) =>
                        {
                            if (_childrenProperty.hasChildren && _childrenProperty.propertyType != SerializedPropertyType.String)
                            {
                                EditorGUILayout.LabelField(_childrenProperty.displayName, EditorStyles.boldLabel);
                                UnityEditorUtility.ForEach(_childrenProperty, (_2ndLayerChildrenProperty) =>
                                {
                                    EditorGUI.indentLevel++;
                                    EditorGUILayout.PropertyField(_2ndLayerChildrenProperty, true);
                                    EditorGUI.indentLevel--;
                                }
                                                           );
                            }
                            else
                            {
                                EditorGUILayout.PropertyField(_childrenProperty);
                            }
                        }
                                                   );
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndHorizontal();
            }

            return(_isSelected);
        }
        private bool DrawSerializedProperty(SerializedProperty _property)
        {
            if (_property == null || !_property.hasVisibleChildren)
            {
                return(false);
            }

            // Draw header
            bool _isSelected = UnityEditorUtility.DrawPropertyHeader(_property);

            // Draw childrens
            if (_property.hasVisibleChildren && _property.isExpanded)
            {
                GUILayout.Space(-4f);
                GUILayout.BeginHorizontal("HelpBox");
                {
                    GUILayout.Space(8f);
                    GUILayout.BeginVertical();
                    {
                        SerializedProperty _propertyCopy = _property.Copy();
                        SerializedProperty _endProperty  = _property.GetEndProperty();

                        // Move pointer to first child and start drawing
                        _propertyCopy.NextVisible(true);

                        do
                        {
                            if (SerializedProperty.EqualContents(_propertyCopy, _endProperty))
                            {
                                break;
                            }

                            _propertyCopy.isExpanded = true;

                            EditorGUILayout.PropertyField(_propertyCopy, true);
                        } while (_propertyCopy.NextVisible(false));
                    }
                    GUILayout.EndVertical();
                }
                GUILayout.EndHorizontal();
            }

            return(_isSelected);
        }