hoop drop animations, multiemission
This commit is contained in:
35
Assets/Station46/Modules/Hoop/Scripts/ButtonHoop.cs
Normal file
35
Assets/Station46/Modules/Hoop/Scripts/ButtonHoop.cs
Normal 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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user