throbber
ObjectLabel - Unify Community Wiki
`
`4/16/2020
`
`ObjectLabel
`
`From Unify Community Wiki
`
`Author: Eric Haines (Eric5h5)
`
`Contents
`
`1 Description
`2 Usage
`3 JavaScript - ObjectLabel.js
`4 Description
`5 C# - ObjectLabel.cs
`
`Description
`
`Makes a GUIText label follow an object in 3D space. Useful for things like having name tags over players' heads.
`Usage
`
`Attach this script to a GUIText object, and drag the object it should follow into the Target slot. For best results, the
`anchor of the GUIText should probably be set to lower center, depending on what you're doing. Offset is used to
`position the label somewhere relative to the actual target's position. The default of (0, 1, 0) is useful for having the
`label appear above the object, rather than appearing right on top of it. If ClampToScreen is on, the label will never
`disappear even if the target is off the screen, but will attempt to follow as best it can (for example, if the target is
`off to the left of the camera out of sight, the label will still be visible on the left). ClampBorderSize sets how
`much space will be left at the borders if the label is being clamped to the screen, to help ensure that the label is still
`readable and not partially cut off. This is in viewport space, so the default .05 is 5% of the screen's size. If
`UseMainCamera is checked, the first camera in the scene tagged MainCamera will be used. If it's not checked,
`you should drag the desired camera onto the CameraToUse slot, which is otherwise unused if UseMainCamera is
`true.
`
`Note: This script also works with GUITextures.
`JavaScript - ObjectLabel.js
`
`var target : Transform;
`var offset = Vector3.up;
`var clampToScreen = false;
`var clampBorderSize = .05;
`var useMainCamera = true;
`var cameraToUse : Camera;
`private var cam : Camera;
`
`// Object that this label should follow
`// Units in world space to offset; 1 unit above obj
`// If true, label will be visible even if object is
`// How much viewport space to leave at the borders
`// Use the camera tagged MainCamera
`// Only use this if useMainCamera is false
`
`wiki.unity3d.com/index.php?title=ObjectLabel
`
`1/3
`
`Supercell
`Exhibit 1007
`Page 1
`
`

`

`ObjectLabel - Unify Community Wiki
`4/16/2020
`private var thisTransform : Transform;
`private var camTransform : Transform;
`
`function Start () {
`thisTransform = transform;
`if (useMainCamera)
`cam = Camera.main;
`
`else
`
`cam = cameraToUse;
`camTransform = cam.transform;
`
`}
`
`function Update () {
`if (clampToScreen) {
`var relativePosition = camTransform.InverseTransformPoint(target.po
`relativePosition.z = Mathf.Max(relativePosition.z, 1.0);
`thisTransform.position = cam.WorldToViewportPoint(camTransform.Tran
`thisTransform.position = Vector3(Mathf.Clamp(thisTransform.position
` Ma
` th
`
`}
`else {
`
`}
`
`}
`
`thisTransform.position = cam.WorldToViewportPoint(target.position +
`
`@script RequireComponent(GUIText)
`
`Description
`
`Converted to C# by Roidz (Ward Dewaele). Use in the same way as the javascript.
`C# - ObjectLabel.cs
`
`using UnityEngine;
`using System.Collections;
`
`[RequireComponent (typeof (GUIText))]
`public class ObjectLabel : MonoBehaviour {
`
`public Transform target; // Object that this label should follow
`public Vector3 offset = Vector3.up; // Units in world space to offset; 1 unit ab
`public bool clampToScreen = false; // If true, label will be visible even if objec
`public float clampBorderSize = 0.05f; // How much viewport space to leave at the b
`public bool useMainCamera = true; // Use the camera tagged MainCamera
`public Camera cameraToUse ; // Only use this if useMainCamera is false
`Camera cam ;
`Transform thisTransform;
`Transform camTransform;
`
`wiki.unity3d.com/index.php?title=ObjectLabel
`
`2/3
`
`Supercell
`Exhibit 1007
`Page 2
`
`

`

`4/16/2020
`
`ObjectLabel - Unify Community Wiki
`
`void Start ()
`
` {
`
` thisTransform = transform;
` if (useMainCamera)
` cam = Camera.main;
` else
` cam = cameraToUse;
` camTransform = cam.transform;
`}
`
`
`
` void Update()
` {
`
` if (clampToScreen)
` {
` Vector3 relativePosition = camTransform.InverseTransformPoint(target.po
` relativePosition.z = Mathf.Max(relativePosition.z, 1.0f);
` thisTransform.position = cam.WorldToViewportPoint(camTransform.Transfor
` thisTransform.position = new Vector3(Mathf.Clamp(thisTransform.position
` Mathf.Clamp(thisTransform.position.y,
` thisTransform.position.z);
`
` }
` else
` {
` thisTransform.position = cam.WorldToViewportPoint(target.position + off
` }
` }
`
`}
`
`Retrieved from "http://wiki.unity3d.com/index.php?title=ObjectLabel&oldid=18700"
`Categories: JavaScript MonoBehaviour GUI
`
`This page was last modified on 23 November 2014, at 15:23.
`This page has been accessed 100,300 times.
`Content is available under Creative Commons Attribution Share Alike.
`
`wiki.unity3d.com/index.php?title=ObjectLabel
`
`3/3
`
`Supercell
`Exhibit 1007
`Page 3
`
`

This document is available on Docket Alarm but you must sign up to view it.


Or .

Accessing this document will incur an additional charge of $.

After purchase, you can access this document again without charge.

Accept $ Charge
throbber

Still Working On It

This document is taking longer than usual to download. This can happen if we need to contact the court directly to obtain the document and their servers are running slowly.

Give it another minute or two to complete, and then try the refresh button.

throbber

A few More Minutes ... Still Working

It can take up to 5 minutes for us to download a document if the court servers are running slowly.

Thank you for your continued patience.

This document could not be displayed.

We could not find this document within its docket. Please go back to the docket page and check the link. If that does not work, go back to the docket and refresh it to pull the newest information.

Your account does not support viewing this document.

You need a Paid Account to view this document. Click here to change your account type.

Your account does not support viewing this document.

Set your membership status to view this document.

With a Docket Alarm membership, you'll get a whole lot more, including:

  • Up-to-date information for this case.
  • Email alerts whenever there is an update.
  • Full text search for other cases.
  • Get email alerts whenever a new case matches your search.

Become a Member

One Moment Please

The filing “” is large (MB) and is being downloaded.

Please refresh this page in a few minutes to see if the filing has been downloaded. The filing will also be emailed to you when the download completes.

Your document is on its way!

If you do not receive the document in five minutes, contact support at support@docketalarm.com.

Sealed Document

We are unable to display this document, it may be under a court ordered seal.

If you have proper credentials to access the file, you may proceed directly to the court's system using your government issued username and password.


Access Government Site

We are redirecting you
to a mobile optimized page.





Document Unreadable or Corrupt

Refresh this Document
Go to the Docket

We are unable to display this document.

Refresh this Document
Go to the Docket