Skip to content

[VFX] Fix Mouse Event Binder in player #3411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
5 changes: 3 additions & 2 deletions TestProjects/VisualEffectGraph_HDRP/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"dependencies": {
"com.unity.ide.visualstudio": "2.0.2",
"com.unity.ide.vscode": "1.1.3",
"com.unity.inputsystem": "1.0.2",
"com.unity.render-pipelines.core": "file:../../../com.unity.render-pipelines.core",
"com.unity.render-pipelines.high-definition": "file:../../../com.unity.render-pipelines.high-definition",
"com.unity.render-pipelines.high-definition-config": "file:../../../com.unity.render-pipelines.high-definition-config",
Expand Down Expand Up @@ -51,7 +52,7 @@
"com.unity.testing.visualeffectgraph",
"com.unity.testing.xr",
"com.unity.render-pipelines.visualeffectgraph",
"com.unity.testframework.graphics",
"com.unity.testing.graphics-performance"
"com.unity.testframework.graphics",
"com.unity.testing.graphics-performance"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ PlayerSettings:
m_VersionCode: 1
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 2
cloudProjectId:
framebufferDepthMemorylessMode: 0
projectName:
Expand Down
6 changes: 5 additions & 1 deletion com.unity.visualeffectgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [12.0.0] - 2021-01-11

### Fixed
- VFXEventBinderBase throwing a null reference exception in runtime
- Unexpected compilation warning in VFXMouseBinder [Case 1313003](https://issuetracker.unity3d.com/product/unity/issues/guid/1313003/)

### Changed
- Move Assets/Create/Visual Effects/Visual Effect Graph to Assets/Create/VFX/VFX Graph
- Move Assets/Create/Visual Effects/Visual Effect Defaults to Assets/Create/VFX/VFX Defaults
- Move Assets/Create/Visual Effects/Visual Effect Subgraph Operator to Assets/Create/VFX/VFX Subgraph Operator
- Move Assets/Create/Visual Effects/Visual Effect Subgraph Block to Assets/Create/VFX/VFX Subgraph Block


## [11.0.0] - 2020-10-21

### Added
Expand All @@ -34,6 +37,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [Case 1290493](https://fogbugz.unity3d.com/f/cases/1290493/#BugEvent.1072735759)
- Incorrect path on Linux while targetting Android, IOS or WebGL [Case 1279750](https://issuetracker.unity3d.com/product/unity/issues/guid/1279750/)


## [10.2.0] - 2020-10-19
### Added
- Warning using Depth Collision on unsupported scriptable render pipeline.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ void RayCastAndTriggerEvent(System.Action trigger)
trigger();
}

void OnEnable()
protected override void OnEnable()
{
base.OnEnable();

mouseDown.Enable();
mouseUp.Enable();
mouseDragStart.Enable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ abstract class VFXEventBinderBase : MonoBehaviour
[SerializeField, HideInInspector]
protected VFXEventAttribute eventAttribute;

protected virtual void OnEnable()
{
UpdateCacheEventAttribute();
}

private void OnValidate()
{
UpdateCacheEventAttribute();
}

private void UpdateCacheEventAttribute()
{
if (target != null)
eventAttribute = target.CreateVFXEventAttribute();
Expand Down