hoop drop animations, multiemission

This commit is contained in:
2023-04-11 17:42:59 +02:00
parent a866257535
commit 7e803a5279
22 changed files with 1253 additions and 158 deletions

View File

@@ -0,0 +1,35 @@
using Station46.Modules.Holes.Scripts;
using Station46.Scripts;
using UnityEngine;
namespace Station46.Modules.Hoop.Scripts
{
[RequireComponent(typeof(Animator))]
public class ButtonHoop : Hole
{
private static readonly int PressedHash = Animator.StringToHash("Pressed");
private Animator _animator;
protected override void Start()
{
base.Start();
_animator = GetComponent<Animator>();
ButtonEvent += (_, type) =>
{
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
switch (type)
{
case ButtonEventType.Pressed:
_animator.SetBool(PressedHash, true);
break;
case ButtonEventType.Released:
_animator.SetBool(PressedHash, false);
break;
}
};
}
}
}