summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PlayerAttackAnimator.cs
blob: 10407a63695881b4d4302f91b1ce0ad7a66850f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Collections.Generic;
using UnityEngine;

public class PlayerAttackAnimator : MonoBehaviour
{
	public List<OneShotAnimationBase> animations = new List<OneShotAnimationBase>();

	private ManualAttack playerAttack;

	public void AssignAttack(ManualAttack attack)
	{
		playerAttack = attack;
		playerAttack.onAttack.AddListener(TriggerAnimations);
	}

	private void TriggerAnimations()
	{
		if (!base.gameObject.activeInHierarchy)
		{
			return;
		}
		foreach (OneShotAnimationBase animation in animations)
		{
			animation.Trigger();
		}
	}
}