Beispiel #1
0
        public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
        {
            if (log == null)
            {
                log = (InspectorLog)GetTargetObjectOfProperty(property);

                log.OnLogged += (InspectorLog.LogItem item) =>
                {
                    if (scroll + scrollBuffer == log.FullLog.Count - logSize - 1)
                    {
                        scrollBuffer += 1;
                    }

                    EditorUtility.SetDirty(logParent);
                };
            }

            float height = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;

            if (!log.Expandable || property.isExpanded)
            {
                int logItemsCount = log.Count;

                height += EditorGUIUtility.singleLineHeight * logSize;
            }
            return(height);
        }