#Hi all! I'm looking to make a video with

1 messages · Page 1 of 1 (latest)

vale jetty
#

Thread here! 😄

white copper
#

Hmm, well even though I have used them quite a bit, I would say integration with tools is still pretty confusing.

And also the group of overlays(?) as well. Transient overlays would be nice to see covered tool

#

At one point I remember I also had to get the internal list of overlay parts and manually add to it, but I can't for the life of me remember why...

#

Ahh I found what I had to do. I had to change the contents of a ToolbarOverlay in the constructor depending on certain conditions. Ended up looking something like this

public MyOverlay()  : base(GenSettingsElement.ElementId, ClearAllElement.ElementId, ClearAreaElement.ElementId, BoundsSettingsElement.ElementId, LibraryButton.ElementId,  GeneratorsButton.ElementId)
{
    if (EditorPrefs.GetBool("DeveloperMode", false))
    {
       var elements = (string[])toolbarElements;
                
        // Add developer only elements to the overlay.
        ArrayUtility.Add(ref elements, GenMangerToggle.ElementId); 
                AccessUtility.Field(typeof(ToolbarOverlay),"m_ToolbarElementIds").SetValue(this, elements);
        }
            
    if (!APIManager.Instance.IsLoggedIn)
        AccessUtility.Field(typeof(ToolbarOverlay), "m_ToolbarElementIds")?.SetValue(this, new string[] { MissingLicenseElement.ElementId });
}
#

On later on when those conditions changed I had to change the array again and call the internal RebuildContent method