An abstract class in Root.Township, Alta.Networking.Animation.
Base for one synced animator parameter (bool, float, trigger) on a NetworkAnimator. A change is resent in the next several syncs so it gets through. Get one from the animator with GetBool, GetFloat or GetTrigger.
Constructors
| Member | What it is |
|---|
AnimatedValue(string name) | Creates an AnimatedValue from name. |
Fields
| Member | What it is |
|---|
protected T value | Backing field for Value. |
3 private and internal fields
| Member | What it is |
|---|
private NetworkAnimator animator | The NetworkAnimator that owns this value. |
private int index | This value's position in the animator's list of values. |
private string name | The animator parameter name. |
Properties
| Member | What it is |
|---|
NetworkAnimator Animator { get; } | The network animator this value belongs to. |
int Changed { get; set; } | How many more syncs will include this value. Counts down to 0. |
virtual int ChangedCounter { get; } | How many syncs a change is sent in (10 by default). |
virtual string GUIName { get; } | Name and current value, for debug display. |
int Index { get; } | Index of the parameter in the animator. |
string Name { get; } | Animator parameter name. |
virtual T Value { get; set; } | The current value. Setting a different value marks it changed and applies it. |
Methods
| Member | What it is |
|---|
virtual void GUI() | Debug GUI hook. Does nothing by default. |
virtual void Initialize(NetworkAnimator animator, int index) | Links the value to its animator and index. |
virtual void Serialize(Stream stream, bool isWriteFull) | Writes or reads a flag and, if set (changed or full write), the value itself. |
protected abstract void Serialize(Stream stream) | Writes or reads a flag and, if set (changed or full write), the value itself. |
protected abstract void Update() | Applies the value to the local animator. Implement in subclasses. |