make particles beat based

just waiting on mine to fix the offset bug
This commit is contained in:
AstrlJelly 2023-12-30 16:43:03 -05:00
parent 9bb5836de8
commit 28726add37
2 changed files with 16 additions and 14 deletions

View file

@ -16,7 +16,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &7113627674537123824
Transform:
m_ObjectHideFlags: 0
@ -263,7 +263,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 344575782839395223}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -25, y: 2.81, z: 0}
m_LocalPosition: {x: -23.14, y: 1.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -2077,7 +2077,7 @@ ParticleSystem:
m_GameObject: {fileID: 5367660552507315250}
serializedVersion: 8
lengthInSec: 0.1
simulationSpeed: 1.3
simulationSpeed: 1
stopAction: 0
cullingMode: 0
ringBufferMode: 0
@ -2151,7 +2151,7 @@ ParticleSystem:
startLifetime:
serializedVersion: 2
minMaxState: 0
scalar: 0.6
scalar: 0.45
minScalar: 5
maxCurve:
serializedVersion: 2
@ -2643,7 +2643,7 @@ ParticleSystem:
gravityModifier:
serializedVersion: 2
minMaxState: 0
scalar: 3.5
scalar: 4
minScalar: 0
maxCurve:
serializedVersion: 2
@ -3228,10 +3228,10 @@ ParticleSystem:
m_RotationOrder: 4
separateAxes: 0
RotationModule:
enabled: 0
enabled: 1
x:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 0
minScalar: 0
maxCurve:
@ -3284,7 +3284,7 @@ ParticleSystem:
m_RotationOrder: 4
y:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 0
minScalar: 0
maxCurve:
@ -3337,9 +3337,9 @@ ParticleSystem:
m_RotationOrder: 4
curve:
serializedVersion: 2
minMaxState: 0
scalar: 0.7853982
minScalar: 0.7853982
minMaxState: 3
scalar: 1.2217305
minScalar: -1.2217305
maxCurve:
serializedVersion: 2
m_Curve:
@ -8004,7 +8004,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8541881261740536524}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -16, y: -4, z: 0}
m_LocalPosition: {x: -20.58, y: -4.49, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []

View file

@ -110,11 +110,13 @@ namespace HeavenStudio.Games.Scripts_MeatGrinder
MeatType.BaconBall or _ => (0.667f, 1),
};
var sheetAnim = game.MeatSplash.textureSheetAnimation;
var main = game.MeatSplash.main;
sheetAnim.frameOverTime = new ParticleSystem.MinMaxCurve(rangeStart, rangeEnd);
main.simulationSpeed = 0.5f / Conductor.instance.pitchedSecPerBeat;
// has a probability of zero normally so it's not played with Play() but this exposes it to the editor
int amount = (int)game.MeatSplash.emission.GetBurst(0).count.constant;
game.MeatSplash.Emit(new ParticleSystem.EmitParams(), amount);
var emission = game.MeatSplash.emission;
game.MeatSplash.Emit(new ParticleSystem.EmitParams(), (int)emission.GetBurst(0).count.constant);
if (tackReaction.expression > 0) {
BeatAction.New(game, new List<BeatAction.Action>() {