Skip to content

Commit 8d8cbb6

Browse files
author
Paul Demeulenaere
committed
Fix Mouse Event Binder in player (#175)
* Fix missing call to CreateVFXEventAttribute OnValidate is only called in editor, in runtime, we should init cache data with OnEnable * *Update changelog.md # Conflicts: # com.unity.visualeffectgraph/CHANGELOG.md
1 parent d4d9c2c commit 8d8cbb6

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

com.unity.visualeffectgraph/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [12.0.0] - 2021-01-11
8-
9-
Version Updated
10-
The version number for this package has increased due to a version update of a related graphics package.
8+
### Fixed
9+
- VFXEventBinderBase throwing a null reference exception in runtime
1110

1211
## [11.0.0] - 2020-10-21
1312
### Added
@@ -27,6 +26,7 @@ The version number for this package has increased due to a version update of a r
2726
- Fix [Case 1290493](https://fogbugz.unity3d.com/f/cases/1290493/#BugEvent.1072735759)
2827
- Incorrect path on Linux while targetting Android, IOS or WebGL [Case 1279750](https://issuetracker.unity3d.com/product/unity/issues/guid/1279750/)
2928

29+
3030
## [10.2.0] - 2020-10-19
3131
### Added
3232
- Warning using Depth Collision on unsupported scriptable render pipeline.

com.unity.visualeffectgraph/Runtime/Utilities/EventBinding/VFXEventBinderBase.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,17 @@ abstract class VFXEventBinderBase : MonoBehaviour
1313
[SerializeField, HideInInspector]
1414
protected VFXEventAttribute eventAttribute;
1515

16+
protected void OnEnable()
17+
{
18+
UpdateCacheEventAttribute();
19+
}
20+
1621
private void OnValidate()
22+
{
23+
UpdateCacheEventAttribute();
24+
}
25+
26+
private void UpdateCacheEventAttribute()
1727
{
1828
if (target != null)
1929
eventAttribute = target.CreateVFXEventAttribute();

0 commit comments

Comments
 (0)