Hi there! I am the creator of S.A.M. - The Streamable Assets Manager . I do not own Odin inspector but have several users that are having compatibility issues between my asset and yours. I’m hoping you can help me figure out what’s going on.
The issues:
For some components, when viewed in the inspector the editor become very laggy and sometimes even crashes. The inspector just shows the first Header Attribute (if there is one present) repeated multiple times.
Repeated Header Text
Users also get this exception in some instances:
StackOverflowException
I have narrowed the issue down to my use of a custom PropertyAttribute and DecoratorDrawer:
Custom Property Attribute
public class SAMGuideButton : PropertyAttribute
{
public string chapterName, sectionName;
public SAMGuideButton(string chapterName, string sectionName)
{
this.chapterName = chapterName;
this.sectionName = sectionName;
}
}
Custom Decorator Drawer
[CustomPropertyDrawer(typeof(SAMGuideButton))]
class SAMGuideButtonDrawer : DecoratorDrawer
{
SAMGuideButton button
{
get { return ((SAMGuideButton)attribute); }
}
public override void OnGUI(Rect position)
{
var position2 = new Rect(position.x + position.width - 22f, position.y, 22f, position.height);
if (GUI.Button(position2, guideButtonLabel))
Application.OpenURL($"https://deepspacelabs.net/html/sam/docs/documentation_main.html?section={button.chapterName.RemoveWhitespace()}_{button.sectionName.RemoveWhitespace()}");
}
readonly GUIContent guideButtonLabel = new GUIContent("?", "Hold Shift and Click to open new guide window; otherwise, Chapter/Section will open in existing guide if there is one.");
}
Example Use
[SAMGuideButton("Hierarchy Organizers", "Overview")]
[Header("Basic Organizer Settings")]
[SerializeField]
int minChunksToAddPerFrame = 10;
Removing the Header attribute does not resolve the issue, so it doesn’t appear to be an issue with using multiple attributes. There are no issues if Odin Inspector is not installed in the project. Any help would be greatly appreciated, thanks!