43 lines
877 B
C#
43 lines
877 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using BITFALL.Entities;
|
|
using BITFALL.Player.Movement;
|
|
using BITKit;
|
|
using BITKit.Animations;
|
|
using BITKit.Entities;
|
|
using UnityEngine;
|
|
|
|
namespace BITFALL.Feel
|
|
{
|
|
public sealed class PlayerHandAnimations : EntityComponent
|
|
{
|
|
[SerializeField] private UnityAnimator animator;
|
|
|
|
[Inject]
|
|
private IPlayerMovement _playerMovement;
|
|
[Inject]
|
|
private IKnockdown _knockdown;
|
|
public override void OnStart()
|
|
{
|
|
_playerMovement.OnParachuteOpened += OnParachuteOpened;
|
|
_playerMovement.OnParachuteClosed += OnParachuteClosed;
|
|
|
|
_knockdown.OnKnockdown += OnKnockdown;
|
|
}
|
|
private void OnKnockdown()
|
|
{
|
|
animator.Play("OnKnockdown");
|
|
}
|
|
|
|
private void OnParachuteClosed()
|
|
{
|
|
animator.Play("OnParachuteClosed");
|
|
}
|
|
private void OnParachuteOpened()
|
|
{
|
|
animator.Play("OnParachute");
|
|
}
|
|
}
|
|
|
|
}
|