Comments (2)
For the moment, here are two samples for dealing with this issue:
from fullinspector.
This was quite a bit of work, but there is now a reasonably high quality implementation (though, it needs to be tested more).
Here's an example showing how comments are now implemented.
CommentAttribute.cs
using System;
namespace FullInspector {
/// <summary>
/// A comment attribute adds a comment to an object that is viewable in the inspector.
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class |
AttributeTargets.Struct)]
public class CommentAttribute : Attribute {
public string Comment;
public CommentAttribute(string comment) {
Comment = comment;
}
}
}
CommentAttributeEditor.cs
using UnityEditor;
using UnityEngine;
namespace FullInspector.Internal {
[CustomAttributePropertyEditor(typeof(CommentAttribute), ReplaceOthers = false)]
public class CommentAttributeEditor<T> : AttributePropertyEditor<T, CommentAttribute> {
protected override T Edit(Rect region, GUIContent label, T element, CommentAttribute attribute) {
EditorGUI.HelpBox(region, attribute.Comment, MessageType.None);
return element;
}
protected override float GetElementHeight(GUIContent label, T element, CommentAttribute attribute) {
return CommentUtils.GetCommentHeight(attribute.Comment);
}
}
}
from fullinspector.
Related Issues (20)
- Toolkit's DefaultInspector not working inside groups
- Inspector GUI very slow when showing lots of SharedInstances HOT 4
- Editor callbacks can't get unregistered, so some methods that re-add themselves accumulate callbacks
- Add MinMaxSlider to the toolkit
- "Proxy editor for Gradient" leaking HOT 1
- Property editors breaking tk.Slider (and tk.IntSlider) HOT 2
- Error with Unity 5.5 HOT 1
- Dictionary, Property (Unity 5.5) - InvalidCastException: Cannot cast from source type to destination type HOT 1
- Visual Studio CPU usage spikes when working on a GetEditor() method for the Toolkit HOT 2
- Delegate serialization causing prefab checkout HOT 1
- Unity Editor crashes when reloading the assemblies. HOT 2
- No activity anymore? HOT 6
- nvm HOT 1
- database browsing Feature request.
- Multi Selecting prefabs and changing color field causes exception HOT 2
- Animation Curves not serialized (?) in Unity 2017 HOT 10
- warnings when reseting metadata HOT 2
- FullInspector with Json.NET as the default serializer : empty data with Resources.Load() HOT 3
- BaseScriptableObject that implements IList<T> breaks inspector HOT 2
- fiGUI PushLabelWidth & PopLabelWidth not balanced - Memory leak & UI Issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fullinspector.