expose camera ease + spam prevention

This commit is contained in:
Rapandrasmus 2024-02-28 15:59:15 +01:00
parent 18c3504739
commit be3a8ccf5f
5 changed files with 70 additions and 4 deletions

View file

@ -14,16 +14,18 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
[Header("Properties")] [Header("Properties")]
[SerializeField] private double _zoomInLength = 0.25; [SerializeField] private double _zoomInLength = 0.25;
[SerializeField] private float _zoomInPower = 4f; [SerializeField] private float _zoomInPower = 4f;
[SerializeField] private EasingFunction.Ease _ease = EasingFunction.Ease.EaseOutBounce;
private bool _rested = false; private bool _rested = false;
private LumBEARjack.RestSoundChoice _restSound; private LumBEARjack.RestSoundChoice _restSound;
private float _cameraPointZFrom; private float _cameraPointZFrom;
private EasingFunction.Function _cameraFunc = EasingFunction.GetEasingFunction(EasingFunction.Ease.EaseOutBounce); private EasingFunction.Function _cameraFunc;
private void Awake() private void Awake()
{ {
_cameraPointZFrom = _cameraPoint.localPosition.z; _cameraPointZFrom = _cameraPoint.localPosition.z;
_cameraFunc = EasingFunction.GetEasingFunction(_ease);
} }
public void SwingWhiff(bool sound = true) public void SwingWhiff(bool sound = true)

View file

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using HeavenStudio.Util; using HeavenStudio.Util;
using UnityEngine.UIElements;
namespace HeavenStudio.Games.Scripts_LumBEARjack namespace HeavenStudio.Games.Scripts_LumBEARjack
{ {
@ -16,6 +17,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private LumBEARjack.BigType _type; private LumBEARjack.BigType _type;
private bool _right = true; private bool _right = true;
private PlayerActionEvent _hitActionEvent;
private PlayerActionEvent _cutActionEvent; private PlayerActionEvent _cutActionEvent;
private double _rotationBeat; private double _rotationBeat;
@ -34,7 +36,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
_rotationBeat = beat + (length / 4 * 2); _rotationBeat = beat + (length / 4 * 2);
_rotationLength = length / 4; _rotationLength = length / 4;
if (startUpBeat <= beat + (length / 4 * 2)) LumBEARjack.instance.ScheduleInput(beat, length / 4 * 2, Minigame.InputAction_BasicPress, JustHit, Miss, Blank); if (startUpBeat <= beat + (length / 4 * 2)) _hitActionEvent = LumBEARjack.instance.ScheduleInput(beat, length / 4 * 2, Minigame.InputAction_BasicPress, JustHit, Miss, Blank);
else else
{ {
_rotationBeat = beat + (length / 4 * 3); _rotationBeat = beat + (length / 4 * 3);
@ -46,6 +48,17 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private void Update() private void Update()
{ {
if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress) && !LumBEARjack.instance.IsExpectingInputNow(Minigame.InputAction_BasicPress))
{
LumBEARjack.instance.ScoreMiss();
Miss(null);
if (_hitActionEvent != null)
{
_hitActionEvent.Disable();
_hitActionEvent.QueueDeletion();
}
return;
}
_rotateObject.Move(_rotationBeat, _rotationLength, _right); _rotateObject.Move(_rotationBeat, _rotationLength, _right);
} }

View file

@ -23,6 +23,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private bool _zoom = true; private bool _zoom = true;
private bool _baby = true; private bool _baby = true;
private PlayerActionEvent _initialAction;
private PlayerActionEvent[] _soundsToDeleteIfMiss = new PlayerActionEvent[3]; private PlayerActionEvent[] _soundsToDeleteIfMiss = new PlayerActionEvent[3];
private double _rotationBeat; private double _rotationBeat;
@ -63,7 +64,7 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
_rotationBeat = beat + (length / 6 * 2); _rotationBeat = beat + (length / 6 * 2);
_rotationLength = length / 6; _rotationLength = length / 6;
if (startUpBeat <= beat + (length / 6 * 2)) LumBEARjack.instance.ScheduleInput(beat, length / 6 * 2, Minigame.InputAction_BasicPress, JustHit1, Miss, Blank); if (startUpBeat <= beat + (length / 6 * 2)) _initialAction = LumBEARjack.instance.ScheduleInput(beat, length / 6 * 2, Minigame.InputAction_BasicPress, JustHit1, Miss, Blank);
else else
{ {
_rotationBeat = beat + (length / 6 * 3); _rotationBeat = beat + (length / 6 * 3);
@ -90,6 +91,17 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private void Update() private void Update()
{ {
if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress) && !LumBEARjack.instance.IsExpectingInputNow(Minigame.InputAction_BasicPress))
{
LumBEARjack.instance.ScoreMiss();
Miss(null);
if (_initialAction != null)
{
_initialAction.Disable();
_initialAction.QueueDeletion();
}
return;
}
_rotateObject.Move(_rotationBeat, _rotationLength, _right); _rotateObject.Move(_rotationBeat, _rotationLength, _right);
} }

View file

@ -23,6 +23,8 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
private double _rotationBeat; private double _rotationBeat;
private double _rotationLength; private double _rotationLength;
private PlayerActionEvent _inputEvent;
private void Awake() private void Awake()
{ {
_log.SetActive(false); _log.SetActive(false);
@ -59,12 +61,20 @@ namespace HeavenStudio.Games.Scripts_LumBEARjack
_rotationBeat = beat + (length / 3 * 2); _rotationBeat = beat + (length / 3 * 2);
_rotationLength = length / 3; _rotationLength = length / 3;
LumBEARjack.instance.ScheduleInput(beat, length / 3 * 2, Minigame.InputAction_BasicPress, Just, Miss, Blank); _inputEvent = LumBEARjack.instance.ScheduleInput(beat, length / 3 * 2, Minigame.InputAction_BasicPress, Just, Miss, Blank);
Update(); Update();
} }
private void Update() private void Update()
{ {
if (PlayerInput.GetIsAction(Minigame.InputAction_BasicPress) && !LumBEARjack.instance.IsExpectingInputNow(Minigame.InputAction_BasicPress))
{
LumBEARjack.instance.ScoreMiss();
Miss(_inputEvent);
_inputEvent.Disable();
_inputEvent.QueueDeletion();
return;
}
if (_type == LumBEARjack.SmallType.bat) if (_type == LumBEARjack.SmallType.bat)
{ {
_rotateObject.SingleMove(_rotationBeat, _rotationLength, _right); _rotateObject.SingleMove(_rotationBeat, _rotationLength, _right);

View file

@ -298,5 +298,34 @@ MonoBehaviour:
- Assets/Scripts/Games/LumBEARjack/LBJBaby.cs - Assets/Scripts/Games/LumBEARjack/LBJBaby.cs
- Assets/Scripts/Games/LumBEARjack/LBJObjectRotate.cs - Assets/Scripts/Games/LumBEARjack/LBJObjectRotate.cs
- Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs - Assets/Scripts/Games/LumBEARjack/LBJMissObject.cs
- Assets/Scripts/LevelEditor/RemixPropertiesDialog/PropertyPrefabs/BoolChartPropertyPrefab.cs
- Assets/Plugins/Starpelly/Textures.cs
- Assets/Plugins/Starpelly/OS.cs
- Assets/Plugins/Color picker/ColorPreview.cs
- Assets/Scripts/Games/Manzai/Manzai.cs
- Assets/Plugins/Starpelly/Starpelly.cs
- Assets/Scripts/LevelEditor/Tooltip.cs
- Assets/Scripts/Games/SoundEffects.cs
- Assets/Plugins/Starpelly/Random.cs
- Assets/Plugins/Starpelly/OperatingSystem/Linux.cs
- Assets/Plugins/Starpelly/Utils.cs
- Assets/Plugins/Starpelly/Enums/Windows.cs
- Assets/Plugins/Starpelly/OperatingSystem/Windows.cs
- Assets/Plugins/Starpelly/Pelly.cs
- Assets/Plugins/Starpelly/Enums/StringType.cs
- Assets/Plugins/Starpelly/OperatingSystem/User32.cs
- Assets/Plugins/Starpelly/Extensions.cs
- Assets/Plugins/Starpelly/ScreenUtility.cs
- Assets/Plugins/Starpelly/Properties/Strings.cs
- Assets/Plugins/Starpelly/Anchors.cs
- Assets/Plugins/Starpelly/Properties/Arrays.cs
- Assets/Plugins/Starpelly/OperatingSystem/IOperatingSystem.cs
- Assets/Scripts/LevelEditor/RemixPropertiesDialog/RemixPropertyPrefab.cs
- Assets/Scripts/LevelEditor/Timeline/LayerLabel.cs
- Assets/Plugins/Starpelly/Transformer.cs
- Assets/Plugins/Starpelly/RendererExtensions.cs
- Assets/Scripts/Util/StringUtils.cs
- Assets/Plugins/Starpelly/OperatingSystem/MacOS.cs
- Assets/Plugins/Starpelly/Common.cs
PathsToSkipImportEvent: [] PathsToSkipImportEvent: []
PathsToIgnoreOverwriteSettingOnAttribute: [] PathsToIgnoreOverwriteSettingOnAttribute: []