A class in Root.Township, Alta.Character.
Simple component that turns a transform (an eye) to look at a target each frame, then applies a rotation limit.
Constructors
| Member | What it is |
|---|
EyeFocus() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private float eyeMovementSpeed | How fast the eye turns (default 50). |
private Quaternion lastRotation | The rotation from the last update, eased from towards the target. |
private RotationLimit rotationLimit | Rotation limit applied after turning. |
private Transform target | Backing field for Target. |
private Transform toRotate | The transform that is turned. |
Properties
| Member | What it is |
|---|
Transform Target { get; set; } | What the eye looks at. Null stops it moving. |
Methods
| Member | What it is |
|---|
void Setup(Transform toRotate, RotationLimit rotationLimit) | Sets the transform to rotate and the rotation limit to apply. |
2 private and internal methods
| Member | What it is |
|---|
private void ForceUpdate() | Editor context menu item that runs one look update. |
private void LateUpdate() | Eases toRotate towards looking at the target and applies the rotation limit. Does nothing without a target. |
Used in
Members of other types that take, return or hold a EyeFocus: