Skip to content

Commit

Permalink
Merge pull request #1201 from anatawa12/particle-system-local-scale
Browse files Browse the repository at this point in the history
fix: Particle System uses local scale will be broken
  • Loading branch information
anatawa12 authored Sep 23, 2024
2 parents 0ab6313 + ea2772d commit 17e2308
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-PRERELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog].

### Fixed
- Null Reference Exception with newly created VRCAnimatorPlayAudio `#1199`
- Particle System that uses local scale will be broken `#1197`

### Security

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog].

### Fixed
- Null Reference Exception with newly created VRCAnimatorPlayAudio `#1199`
- Particle System that uses local scale will be broken `#1197`

### Security

Expand Down
6 changes: 6 additions & 0 deletions Editor/APIInternal/ComponentInfos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ protected override void CollectDependency(ParticleSystem component, ComponentDep
{
collector.MarkEntrypoint();

// Some particle system module refers local scale instead of hierarchy / global scale
// so we need to keep parent transform.
// TODO: it might be better to check if the particle system is in local space or not.
// TODO: it might be better to provide API to keep local scale.
collector.AddDependency(component.transform.parent);

if (component.main.simulationSpace == ParticleSystemSimulationSpace.Custom) // not animated
collector.AddDependency(component.main.customSimulationSpace);

Expand Down

0 comments on commit 17e2308

Please sign in to comment.