projectEli/Assets/NeoFPS/Core/Weapons/WieldableTools/ProceduralToolSprintHandler.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
using NeoFPS.WieldableTools;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NeoFPS
{
[RequireComponent(typeof(WieldableTool))]
public class ProceduralToolSprintHandler : ProceduralSprintAnimationHandler
{
private WieldableTool m_WieldableTool = null;
protected override void Awake()
{
base.Awake();
m_WieldableTool = GetComponent<WieldableTool>();
m_WieldableTool.onPrimaryActionStart += OnPrimaryActionStart;
m_WieldableTool.onPrimaryActionEnd += OnPrimaryActionEnd;
m_WieldableTool.onSecondaryActionStart += OnSecondaryActionStart;
m_WieldableTool.onSecondaryActionEnd += OnSecondaryActionEnd;
}
private void OnPrimaryActionStart()
{
AddAnimationBlocker();
}
private void OnPrimaryActionEnd()
{
RemoveAnimationBlocker();
}
private void OnSecondaryActionStart()
{
AddAnimationBlocker();
}
private void OnSecondaryActionEnd()
{
RemoveAnimationBlocker();
}
}
}