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;
}
};
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 8418942d5fe34028bdc0165490d5abf7
timeCreated: 1683724488

View File

@@ -14,7 +14,7 @@ namespace Station46.Modules.Hoop.Scripts
/// The main component for the orb throwing module.
/// </summary>
[RequireComponent(typeof(Collider))]
public class Hoop : StatePuzzle
public class FlingHoop : StatePuzzle
{
[Tooltip("How long to wait in seconds until the state is updated. Orbs that do not stay in the hoop should not be counted.")]
public float updateDelay;