19 [Tooltip(
"Transform that scale and offset will be applied to.")]
20 private Transform backgroundTransform;
22 private float depth = 1f;
38 if (BackgroundRenderer)
40 BackgroundRenderer.enabled = value;
48 public Transform BackgroundTransform
52 return backgroundTransform;
57 backgroundTransform = value;
63 if (BackgroundRenderer != null)
66 Vector3 localContentSize = toolTip.LocalContentSize;
67 Vector3 localContentOffset = toolTip.LocalContentOffset;
71 Bounds meshBounds = BackgroundRenderer.GetComponent<MeshFilter>().sharedMesh.bounds;
72 localContentSize.x /= meshBounds.size.x;
73 localContentSize.y /= meshBounds.size.y;
74 localContentSize.z = depth;
77 if (localContentSize.x > 0 && localContentSize.y > 0)
79 localContentBounds =
new Bounds(localContentOffset, localContentSize);
84 private void OnDrawGizmos()
86 if (Application.isPlaying)
90 toolTip = gameObject.GetComponent<
ToolTip>();