Skip to main content

CharacterEye

A class in Root.Township, Alta.Character.

Build-time setup for one character eye: when the prefab is baked it copies its position to the dummy's eye bone, adds a rotation limit and hands both to EyeFocus, then removes itself.

Constructors​

MemberWhat it is
CharacterEye()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private BoneIdentifier boneWhich rig bone is the eye.
private CharacterDummyPointer dummyPointer to the character dummy whose rig holds the eye bone.
private Transform eyeBoneThe eye bone found during baking.
private EyeFocus eyeFocusThe EyeFocus component set up with the eye bone and its limit.
private RotationLimitSpline limitThe rotation limit added to the eye bone during baking.
private CharacterEye.RotationLimit limitArgumentsAxis, default rotation, twist limit and spline copied onto the eye's rotation limit.

Properties​

1 private and internal property
MemberWhat it is
private int IBuildRendererBakeable.SortingOrder { get; }Always 0.

Methods​

MemberWhat it is
void Bake(bool isSaving)Finds the eye bone on the dummy rig, copies this transform's local pose to it, adds a disabled RotationLimitSpline from limitArguments and sets up eyeFocus.
1 private and internal method
MemberWhat it is
private void IBuildRendererBakeable.Clean()Destroys this component after baking.