Skip to content

Commit 269dedb

Browse files
committed
Update docs
1 parent 176b824 commit 269dedb

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.docfx/filterconfig.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ apiRules:
55
uidRegex: ^UnityEngine
66
- exclude:
77
uidRegex: ^UnityEditor
8+
- exclude:
9+
uidRegex: ^Zigurous.Animation.SmoothDamp.*._value
10+
- exclude:
11+
uidRegex: ^Zigurous.Animation.SmoothDamp.*._velocity

.docfx/manual/animator-parameters.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Animator Parameters
2+
3+
When setting animator parameters in code, it is more efficient to use hash ids instead of strings. The Animation Library package comes with a static class [Parameter](xref:Zigurous.Animation.Parameter) with predefined ids for common animator parameters.
4+
5+
```csharp
6+
private void Foo()
7+
{
8+
animator.SetBool(Parameter.Grounded, false);
9+
animator.SetTrigger(Parameter.Jump, true);
10+
animator.SetFloat(Parameter.Speed, 4.0f);
11+
}
12+
```
13+
14+
### Automatic Hash Ids
15+
16+
The [AnimatorParameter](xref:Zigurous.Animation.AnimatorParameter) struct included in the Animation Library package automatically creates a hash id for a given animator parameter name. Anywhere you might declare a variable for a custom animator paramter name use `AnimatorParameter` instead. It will still be serialized as a string in the editor, but you can use the id when getting or setting an animator parameter.
17+
18+
To learn more, see https://docs.unity3d.com/ScriptReference/Animator.StringToHash.html.
19+
20+
```csharp
21+
public AnimatorParameter parameter = "Time";
22+
public float time;
23+
24+
private void Update()
25+
{
26+
animator.SetFloat(parameter.id, time);
27+
}
28+
```

.docfx/manual/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ The Animation Library package contains assets and scripts for animating Unity ob
1818
### Data Structures
1919

2020
- [AnimatorParameter](xref:Zigurous.Animation.AnimatorParameter)
21+
- [SmoothDampFloat](xref:Zigurous.Animation.SmoothDampFloat)
22+
- [SmoothDampVector2](xref:Zigurous.Animation.SmoothDampVector2)
23+
- [SmoothDampVector3](xref:Zigurous.Animation.SmoothDampVector3)
2124
- [Timing](xref:Zigurous.Animation.Timing)
2225
- [Timing01](xref:Zigurous.Animation.Timing01)
2326
- [TimingRange](xref:Zigurous.Animation.TimingRange)

.docfx/manual/toc.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
href: index.md
33
- name: Installation
44
href: installation.md
5-
- name: Avatar Masks
6-
href: avatar-masks.md
5+
- name: Reference
6+
items:
7+
- name: Animator Parameters
8+
href: animator-parameters.md
9+
- name: Avatar Masks
10+
href: avatar-masks.md

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ using Zigurous.Animation;
4848
### Data Structures
4949

5050
- [AnimatorParameter](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.AnimatorParameter.html)
51+
- [SmoothDampFloat](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.SmoothDampFloat.html)
52+
- [SmoothDampVector2](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.SmoothDampVector2.html)
53+
- [SmoothDampVector3](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.SmoothDampVector3.html)
5154
- [Timing](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.Timing.html)
5255
- [Timing01](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.Timing01.html)
5356
- [TimingRange](https://docs.zigurous.com/com.zigurous.animation/api/Zigurous.Animation.TimingRange.html)

0 commit comments

Comments
 (0)