Class EyeAnimatorBase
Base class for Eye Animators. Implement this class to create a custom eye animator.
public abstract class EyeAnimatorBase : MonoBehaviour, IEyeController
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourEyeAnimatorBase
- Implements
- Derived
Properties
EyeClosedAmount
How much should the left/right eye be closed. 0 is the index of the open eye. Increase number to close the eye.
public abstract Vector2 EyeClosedAmount { get; set; }
Property Value
- Vector2
Remarks
When implementing this property, ignore negatives values and ensure the value does not exceed the number of frames in the collection.
EyeSet
The Eye Set to be used for the Eye. Modify this property to change the eye set.
public abstract FT_EyeSet EyeSet { get; set; }
Property Value
Remarks
When implementing this property, ignore any null fields manually. EyeSet may be null or contain null fields. Those denote values which should not be changed. It is recommended to use the MergeWith(FT_EyeSet) method to merge the new eye set with the current one."/>
LookAtPosition
LookAt position for the eyes in world space.
public abstract Vector3 LookAtPosition { get; set; }
Property Value
- Vector3
Remarks
Ignores (0,0,0) values. Those are used to denote that the LookAt position should not be modified.
Methods
ConvertLookAtToUV(Transform, Vector3, float)
Utility method to convert a world space lookAt position to a UV offset for the eye shader.
protected Vector2 ConvertLookAtToUV(Transform eye, Vector3 targetPosition, float maxEyeRotation = 0.4)
Parameters
eye
TransformEye reference position
targetPosition
Vector3LookAt position
maxEyeRotation
floatMax rotation of the eye in UV space. Scales the rotation (calculatedOffset * maxEyeRotation)
Returns
- Vector2
Vector2 UV coordinate offset for the iris
ForceUpdate()
Forces the eye to update immediately.
public abstract void ForceUpdate()
Remarks
Hook this code to your Material Update code to force the eye to update immediately.