Example #1
0
        private void OnDrawGizmosSelected()
        {
            if (booth == null || targetRectTransform == null)
            {
                return;
            }

            booth.ClearTransformTemporarily();
            if (cornersCache == null)
            {
                cornersCache = new Vector3[4];
            }

            targetRectTransform.GetWorldCorners(cornersCache);
            var min = Vector3.Min(Vector3.Min(cornersCache[0], cornersCache[1]), Vector3.Min(cornersCache[2], cornersCache[2]));
            var max = Vector3.Max(Vector3.Max(cornersCache[0], cornersCache[1]), Vector3.Max(cornersCache[2], cornersCache[2]));

            var bounds = new Bounds();

            bounds.min = min;
            bounds.max = max;

            booth.RestorePosition();

            DrawBoundsGizmos(ref bounds);
            DrawOverhangGizmos(ref bounds);
        }
Example #2
0
        private void OnDrawGizmosSelected()
        {
            if (booth == null || boundsSource == null || boundsSource.IsRemoved)
            {
                return;
            }

            booth.ClearTransformTemporarily();
            var bounds             = boundsSource.Bounds;
            var localBounds        = boundsSource.LocalBounds;
            var localToWorldMatrix = boundsSource.LocalToWorldMatrix;

            booth.RestorePosition();

            DrawOverhangGizmos(ref bounds);
            DrawBoundsGizmos(ref bounds);
            DrawLocalBoundsGizmos(ref localBounds, ref localToWorldMatrix);
        }