Attack animation, colliders, triggering
This commit is contained in:
1 parent
3e631899ea
commit
e61fcb78cf
94 files changed
+142319
-25861
No files matched your search
@@ -1,7 +1,4 @@
|
||||
using System;
|
||||
using Code.OfficeGame.BattleMode.Actions;
|
||||
using KinematicCharacterController;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.OfficeGame.Player
|
||||
@@ -10,18 +7,15 @@ namespace Code.OfficeGame.Player
|
||||
{
|
||||
private static readonly int VelocityForward = Animator.StringToHash("VelocityForward");
|
||||
private static readonly int VelocityRight = Animator.StringToHash("VelocityRight");
|
||||
private static readonly int Attack = Animator.StringToHash("Attack");
|
||||
|
||||
|
||||
private KinematicCharacterMotor _motor;
|
||||
public Animator Animator { get; private set; }
|
||||
public EntityTimelineActor EntityTimelineActor { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_motor = GetComponent<KinematicCharacterMotor>();
|
||||
Animator = GetComponentInChildren<Animator>();
|
||||
EntityTimelineActor = GetComponent<EntityTimelineActor>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -33,16 +27,6 @@ namespace Code.OfficeGame.Player
|
||||
var rightVelocity =
|
||||
Vector3.Project(_motor.Velocity, transform.forward).magnitude;
|
||||
Animator.SetFloat(VelocityRight, rightVelocity);
|
||||
|
||||
if(EntityTimelineActor.CurrentAction)
|
||||
switch (EntityTimelineActor.CurrentAction.ActionType)
|
||||
{
|
||||
case BattleActionType.Wait:
|
||||
break;
|
||||
case BattleActionType.Attack:
|
||||
Animator.SetTrigger(Attack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user