Skip to content

Commit 192b466

Browse files
PaulDemeulenaereGitHub Enterprise
authored andcommitted
Fix case 1279294 : Invalid Random per component behavior in spawn context (#107)
1 parent f6fd8a5 commit 192b466

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2929
- Fix exposed Texture2DArray and Cubemap types from shader graph not being taken into account in Output Mesh [Case 1265221](https://issuetracker.unity3d.com/product/unity/issues/guid/1265221/)
3030
- Allow world position usage in shaderGraph plugged into an alpha/opacity output [Case 1259511](https://issuetracker.unity3d.com/product/unity/issues/guid/1259511/)
3131
- GPU Evaluation of Construct Matrix
32+
- Random Per-Component on Set Attribute in Spawn Context [Case 1279294](https://issuetracker.unity3d.com/product/unity/issues/guid/1279294/)
3233

3334
## [10.0.0] - 2019-06-10
3435
### Added

com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Spawn/VFXSpawnerSetAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public override IEnumerable<VFXNamedExpression> parameters
6969
{
7070
default:
7171
case RandomMode.PerComponent:
72-
random = new VFXExpressionCombine(Enumerable.Repeat(0, size).Select(_ => new VFXExpressionRandom(false, new RandId(this, 1))).ToArray());
72+
random = new VFXExpressionCombine(Enumerable.Range(0, size).Select(i => new VFXExpressionRandom(false, new RandId(this, i))).ToArray());
7373
break;
7474
case RandomMode.Uniform:
75-
random = new VFXExpressionCombine(Enumerable.Repeat(new VFXExpressionRandom(false, new RandId(this, 2)), size).ToArray());
75+
random = new VFXExpressionCombine(Enumerable.Repeat(new VFXExpressionRandom(false, new RandId(this, 0)), size).ToArray());
7676
break;
7777
}
7878
}

0 commit comments

Comments
 (0)