Implemented Animation Clip asset and animation controller #410

Merged
XiaoQiDigipen merged 66 commits from SP3-22-AnimationController into main 2023-03-09 16:19:40 +08:00
6 changed files with 49 additions and 7 deletions
Showing only changes of commit bfbca68d50 - Show all commits

View File

@ -0,0 +1,7 @@
Name: MD_RigTest01_SkinningTestAnims
ID: 203438081
Type: 12
Sub Assets:
Name: Full
ID: 231416496
Type: 13

View File

@ -35,3 +35,6 @@ Type: 13
Name: Jump_End
ID: 228134756
Type: 13
Name: Full
ID: 223752972
Type: 13

View File

@ -19,8 +19,8 @@
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0, y: 0, z: 0}
Rotate: {x: 0, y: 0, z: 0}
Translate: {x: -0.291508496, y: 0, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 1, y: 1, z: 1}
IsActive: true
Renderable Component:
@ -34,6 +34,7 @@
Scripts:
- Type: SHADE.Test.AnimTest
Enabled: true
fullClip: 223752972
idleClip: 227450439
runClip: 229125027
pickUpClip: 219605278
@ -54,3 +55,28 @@
FOV: 90
IsActive: true
Scripts: ~
- EID: 3
Name: Leg
IsActive: true
NumberOfChildren: 0
Components:
Transform Component:
Translate: {x: 0.332949668, y: 0, z: 0}
Rotate: {x: -0, y: 0, z: -0}
Scale: {x: 0.0710000023, y: 0.0710000023, z: 0.0710000023}
IsActive: true
Renderable Component:
Mesh: 141097368
Material: 128805346
IsActive: true
Animator Component:
Rig: 72178939
AnimationController: 0
IsActive: true
Scripts:
- Type: SHADE.Test.AnimTest
Enabled: true
fullClip: 231416496
idleClip: 0
runClip: 0
pickUpClip: 0

View File

@ -4,6 +4,8 @@
{
#region Serialized Fields
[SerializeField]
private AnimationClipAsset fullClip;
[SerializeField]
private AnimationClipAsset idleClip;
[SerializeField]
private AnimationClipAsset runClip;
@ -23,7 +25,11 @@
protected override void update()
{
if (Input.GetKeyUp(Input.KeyCode.Alpha1))
if (Input.GetKeyUp(Input.KeyCode.Equals))
{
Animator.Play(fullClip);
}
else if (Input.GetKeyUp(Input.KeyCode.Alpha1))
{
Animator.Play(idleClip);
}