Example #1
0
        protected bool DrawFoldableContent(Rect position)
        {
            bool dirty = false;

            for (int n = 0; n < 3; n++)
            {
                var draw = members[n];
                if (draw.ShouldShowInInspector)
                {
                    if (draw.Draw(position))
                    {
                        dirty = true;
                    }
                    DrawGUI.NextLine(ref position);
                }
            }

            if (!UsingLocalSpace)
            {
                position.y     += 3f;
                position.height = 18f;

                if (UsingSnapping)
                {
                    position.width = 90f;
                    position.x     = (DrawGUI.InspectorWidth - (90f + 138f + 5f)) * 0.5f;
                    DrawGUI.Active.Label(position, GUIContentPool.Temp("snapping", "You can open snap settings using menu item Edit/Snap Settings..."), "WarningOverlay");

                    position.x    += 95f;
                    position.width = 138f;
                    DrawGUI.Active.Label(position, GUIContentPool.Temp("using world space", "Position, rotation and scale are listed using world space instead of local space."), "WarningOverlay");
                }
                else
                {
                    position.width = 138f;
                    position.x     = (DrawGUI.InspectorWidth - position.width) * 0.5f;

                    DrawGUI.Active.Label(position, GUIContentPool.Temp("using world space", "Position, rotation and scale are listed using world space instead of local space."), "WarningOverlay");
                }
            }
            else if (UsingSnapping)
            {
                position.y     += 3f;
                position.height = 18f;
                position.width  = 90f;
                position.x      = (DrawGUI.InspectorWidth - position.width) * 0.5f;
                DrawGUI.Active.Label(position, GUIContentPool.Temp("snapping", "You can open snap settings using menu item Edit/Snap Settings..."), "WarningOverlay");
            }

            return(dirty);
        }