mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 11:47:40 +02:00
First PlayerActionEvent Pass (#202)
* update blue bear to use PlayerActionEvent * update built to scale DS to use PlayerActionEvent * update clappy trio to use PlayerActionEvent * update crop stomp to use PlayerActionEvent * update drumming practice to use PlayerActionEvent * update fork lifter to use PlayerActionEvent * update minigame icons * update wizard waltz' icon
This commit is contained in:
@ -65,6 +65,7 @@ namespace HeavenStudio.Games
|
||||
private float currentBeltOffset;
|
||||
|
||||
[NonSerialized] public bool shootingThisFrame;
|
||||
[NonSerialized] public bool lastShotOut = false;
|
||||
|
||||
public static BuiltToScaleDS instance;
|
||||
|
||||
@ -118,10 +119,14 @@ namespace HeavenStudio.Games
|
||||
void LateUpdate()
|
||||
{
|
||||
var shooterState = shooterAnim.GetCurrentAnimatorStateInfo(0);
|
||||
bool canShoot = !shooterState.IsName("Shoot") || shooterAnim.IsAnimationNotPlaying();
|
||||
bool canShoot = (!shooterState.IsName("Shoot") || shooterAnim.IsAnimationNotPlaying()) && !shootingThisFrame;
|
||||
|
||||
if (canShoot && PlayerInput.Pressed() && !shootingThisFrame)
|
||||
if (canShoot && lastShotOut)
|
||||
lastShotOut = false;
|
||||
|
||||
if (canShoot && !lastShotOut && PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN))
|
||||
{
|
||||
lastShotOut = true;
|
||||
shootingThisFrame = true;
|
||||
Shoot();
|
||||
SpawnObject(BTSObject.FlyingRod);
|
||||
|
Reference in New Issue
Block a user