37 lines
690 B
C#
37 lines
690 B
C#
|
using UnityEngine;
|
||
|
|
||
|
namespace EntityStates.MegaConstruct;
|
||
|
|
||
|
public class ExitShield : BaseState
|
||
|
{
|
||
|
[SerializeField]
|
||
|
public string animationLayerName;
|
||
|
|
||
|
[SerializeField]
|
||
|
public string animationStateName;
|
||
|
|
||
|
[SerializeField]
|
||
|
public string animationPlaybackParameterName;
|
||
|
|
||
|
[SerializeField]
|
||
|
public float baseDuration;
|
||
|
|
||
|
private float duration;
|
||
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
|
base.OnEnter();
|
||
|
duration = baseDuration / attackSpeedStat;
|
||
|
PlayAnimation(animationLayerName, animationStateName, animationPlaybackParameterName, baseDuration);
|
||
|
}
|
||
|
|
||
|
public override void FixedUpdate()
|
||
|
{
|
||
|
base.FixedUpdate();
|
||
|
if (base.fixedAge > baseDuration)
|
||
|
{
|
||
|
outer.SetNextStateToMain();
|
||
|
}
|
||
|
}
|
||
|
}
|