Beispiel #1
0
 public void Reset()
 {
     startTime         = default(float);
     lastModifiedTime  = default(float);
     tooltipUI         = default(TooltipUI);
     persistent        = default(bool);
     duration          = default(float);
     becameVisible     = default(Action);
     placement         = default(ITooltipPlacement);
     orientationWeight = default(float);
     transitionOffset  = default(Vector3);
     transitionTime    = default(float);
 }
Beispiel #2
0
        Vector3 GetTooltipOffset(TooltipUI tooltipUI, ITooltipPlacement placement, Vector3 transitionOffset)
        {
            if (tooltipUI == null)
            {
                return(Vector3.zero);
            }

            var offset = Vector3.zero;

            if (placement != null)
            {
                switch (placement.tooltipAlignment)
                {
                case TextAlignment.Right:
                    offset = Vector3.left;
                    break;

                case TextAlignment.Left:
                    offset = Vector3.right;
                    break;
                }
            }

            if (placement != null)
            {
                tooltipUI.rectTransform.GetWorldCorners(k_Corners);
                var halfWidth = (k_Corners[0] - k_Corners[2]).magnitude * 0.5f;
                offset *= halfWidth;
            }
            else
            {
                offset = k_Offset * this.GetViewerScale() * Vector3.back;
            }

            offset += transitionOffset;

            return(offset);
        }