return of the tweak

This commit is contained in:
Rapandrasmus 2023-10-08 12:18:20 +02:00
parent ac59780559
commit 09b66aecc0
5 changed files with 17 additions and 15 deletions

View file

@ -563,7 +563,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_fullRotRange: 160 _fullRotRange: 160
_holdLength: 2 _holdLength: 2
_ease: 22 _ease: 4
_holdPadding: 1
_rotateRoot: {fileID: 2616646720197201304} _rotateRoot: {fileID: 2616646720197201304}
_gripPoint: {fileID: 2131794628642567477} _gripPoint: {fileID: 2131794628642567477}
--- !u!114 &-4645702950898394595 --- !u!114 &-4645702950898394595

View file

@ -305,6 +305,7 @@ MonoBehaviour:
_fullRotRange: 160 _fullRotRange: 160
_holdLength: 4 _holdLength: 4
_ease: 4 _ease: 4
_holdPadding: 1
_rotateRoot: {fileID: 4208995891253938729} _rotateRoot: {fileID: 4208995891253938729}
_gripPoint: {fileID: 8714220451416272075} _gripPoint: {fileID: 8714220451416272075}
--- !u!114 &3253363150451868373 --- !u!114 &3253363150451868373

View file

@ -163,7 +163,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_fullRotRange: 160 _fullRotRange: 160
_holdLength: 1 _holdLength: 1
_ease: 22 _ease: 10
_holdPadding: 0.25
_rotateRoot: {fileID: 2068126119450832752} _rotateRoot: {fileID: 2068126119450832752}
_gripPoint: {fileID: 8286548847234487440} _gripPoint: {fileID: 8286548847234487440}
--- !u!114 &3772265357728581139 --- !u!114 &3772265357728581139

View file

@ -649,7 +649,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3530077400513613063} m_GameObject: {fileID: 3530077400513613063}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.649568, y: 0.44255477, z: 0.13394769} m_LocalPosition: {x: 2.599568, y: 0.44255477, z: 0.13394769}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: m_Children:
@ -1116,7 +1116,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5202088941643817628} m_GameObject: {fileID: 5202088941643817628}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.65, y: 0.53, z: 0.13394769} m_LocalPosition: {x: 2.6, y: 0.53, z: 0.13394769}
m_LocalScale: {x: 0.75091, y: 0.75091, z: 0.75091} m_LocalScale: {x: 0.75091, y: 0.75091, z: 0.75091}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -1932,9 +1932,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 2f9ee457016acdc4eb5dbfdc03be0d6f, type: 3} m_Script: {fileID: 11500000, guid: 2f9ee457016acdc4eb5dbfdc03be0d6f, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_fullRotRange: 160 _fullRotRange: 170
_holdLength: 3 _holdLength: 3
_ease: 22 _ease: 10
_holdPadding: 0.5
_holdPaddingStart: 0.5
_rotateRoot: {fileID: 3903953954711634507} _rotateRoot: {fileID: 3903953954711634507}
_gripPoint: {fileID: 3800820123473635694} _gripPoint: {fileID: 3800820123473635694}
--- !u!114 &3068772248330600904 --- !u!114 &3068772248330600904
@ -1965,8 +1967,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
_anim: {fileID: 8483464683545527156} _anim: {fileID: 8483464683545527156}
_animLength: 0.6785714 _animLength: 0.6785714
_beatLength: 3 _beatLength: 2.5
_ease: 22 _ease: 0
--- !u!1 &8302616130811808557 --- !u!1 &8302616130811808557
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1992,7 +1994,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8302616130811808557} m_GameObject: {fileID: 8302616130811808557}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 1.914, y: 1.959, z: 0.13394769} m_LocalPosition: {x: 2.864, y: 1.959, z: 0.13394769}
m_LocalScale: {x: 0.75091, y: 0.75091, z: 0.75091} m_LocalScale: {x: 0.75091, y: 0.75091, z: 0.75091}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []

View file

@ -15,6 +15,8 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
[SerializeField] private float _fullRotRange; [SerializeField] private float _fullRotRange;
[SerializeField] private double _holdLength; [SerializeField] private double _holdLength;
[SerializeField] private EasingFunction.Ease _ease = EasingFunction.Ease.EaseInOutQuad; [SerializeField] private EasingFunction.Ease _ease = EasingFunction.Ease.EaseInOutQuad;
[SerializeField] private double _holdPadding = 0.5;
[SerializeField] private double _holdPaddingStart = 0;
private double _startBeat; private double _startBeat;
private double _expirationBeat = -1; private double _expirationBeat = -1;
@ -57,7 +59,7 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
var cond = Conductor.instance; var cond = Conductor.instance;
if (!cond.isPlaying) return; if (!cond.isPlaying) return;
float normalNoMod = Mathf.Abs(cond.GetPositionFromBeat(_startBeat, _holdLength)); float normalNoMod = Mathf.Abs(cond.GetPositionFromBeat(_startBeat - _holdPaddingStart, _holdLength + _holdPadding + _holdPaddingStart));
float normalizedBeat = normalNoMod % 1; float normalizedBeat = normalNoMod % 1;
@ -68,11 +70,6 @@ namespace HeavenStudio.Games.Scripts_AnimalAcrobat
float newAngleZ = _func(-_halfRotRange, _halfRotRange, normalizedBeat); float newAngleZ = _func(-_halfRotRange, _halfRotRange, normalizedBeat);
_rotateRoot.localEulerAngles = new Vector3(0, 0, newAngleZ); _rotateRoot.localEulerAngles = new Vector3(0, 0, newAngleZ);
if (cond.songPositionInBeatsAsDouble >= _expirationBeat)
{
gameObject.SetActive(false);
}
} }
public bool IsAvailableAtBeat(double beat) public bool IsAvailableAtBeat(double beat)