比较提交
合并到: unity-tech-cn:main
unity-tech-cn:/main
unity-tech-cn:/2018.3
unity-tech-cn:/feature-callable-flow
unity-tech-cn:/feature-sceneview-toolbar-preferences
unity-tech-cn:/feature-handle-drop-rlist
unity-tech-cn:/refactor-handle-modules
unity-tech-cn:/feature-cinemachine-noise-shake
unity-tech-cn:/feature-new-input-system
unity-tech-cn:/update-starters
unity-tech-cn:/feature-on-vfx-output-event
unity-tech-cn:/patches-2020.2.7-patch.1
unity-tech-cn:/feature-generic-animation-rigs
unity-tech-cn:/fix-pickups
unity-tech-cn:/refactor-2021-2-sceneview-toolbar
unity-tech-cn:/refactor-gui-overhaul
unity-tech-cn:/refactor-messager-dict-keys
unity-tech-cn:/fix-enterplaymode
unity-tech-cn:/refactor-manager-dependencies
unity-tech-cn:/feature-asset-dependency-explorer
拉取从: unity-tech-cn:feature-on-vfx-output-event
unity-tech-cn:/main
unity-tech-cn:/2018.3
unity-tech-cn:/feature-callable-flow
unity-tech-cn:/feature-sceneview-toolbar-preferences
unity-tech-cn:/feature-handle-drop-rlist
unity-tech-cn:/refactor-handle-modules
unity-tech-cn:/feature-cinemachine-noise-shake
unity-tech-cn:/feature-new-input-system
unity-tech-cn:/update-starters
unity-tech-cn:/feature-on-vfx-output-event
unity-tech-cn:/patches-2020.2.7-patch.1
unity-tech-cn:/feature-generic-animation-rigs
unity-tech-cn:/fix-pickups
unity-tech-cn:/refactor-2021-2-sceneview-toolbar
unity-tech-cn:/refactor-gui-overhaul
unity-tech-cn:/refactor-messager-dict-keys
unity-tech-cn:/fix-enterplaymode
unity-tech-cn:/refactor-manager-dependencies
unity-tech-cn:/feature-asset-dependency-explorer
此合并请求有变更与目标分支冲突。
/Runtime/LevelScripting/Actions/VFXSendEventAction.cs
/Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs
/CHANGELOG.md
2 次代码提交
作者 | SHA1 | 备注 | 提交日期 |
---|---|---|---|
Thomas ICHÉ | ca85f029 | Updated Changelog | 4 年前 |
Thomas ICHÉ | 8b84168d | Added OnVFXOutputEvent / Fixes for VFX Actions / Added AssemblyInfo Defines | 4 年前 |
共有 9 个文件被更改,包括 157 次插入 和 12 次删除
-
3Editor/PropertyDrawers/CallableReorderableList.cs
-
5Runtime/GameplayIngredients.asmdef
-
1Runtime/GameplayIngredients.cs
-
19Runtime/LevelScripting/Actions/VFXSendEventAction.cs
-
20Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs
-
42Icons/Misc/ic-vfx.png
-
6CHANGELOG.md
-
62Runtime/LevelScripting/Events/OnVFXOutputEvent.cs
-
11Runtime/LevelScripting/Events/OnVFXOutputEvent.cs.meta
|
|||
using UnityEngine; |
|||
#if PACKAGE_VFXGRAPH
|
|||
using UnityEngine.VFX; |
|||
#endif
|
|||
|
|||
namespace GameplayIngredients.Events |
|||
{ |
|||
#if !PACKAGE_VFXGRAPH
|
|||
[WarnDisabledModule("Visual Effect Graph")] |
|||
#else
|
|||
[AddComponentMenu(ComponentMenu.vfxPath + "On VFX Output Event")] |
|||
[RequireComponent(typeof(VisualEffect))] |
|||
#endif
|
|||
public class OnVFXOutputEvent : EventBase |
|||
{ |
|||
public string vfxEventName { get => m_VFXEventName; set { m_VFXEventName = value; CacheEventName(); } } |
|||
[SerializeField] |
|||
string m_VFXEventName = "On Received Event"; |
|||
int m_VFXEventID; |
|||
|
|||
[SerializeField] |
|||
protected Callable[] onEventReceived; |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
CacheEventName(); |
|||
#if PACKAGE_VFXGRAPH
|
|||
GetComponent<VisualEffect>().outputEventReceived += OnVFXOutputEvent_Received; |
|||
#else
|
|||
Debug.LogWarning("OnVFXOutputEvent could not attach to VFX as VFX Graph package is not installed, if you're running HDRP or URP, please install it using package manager."); |
|||
#endif
|
|||
} |
|||
|
|||
private void OnDisable() |
|||
{ |
|||
#if PACKAGE_VFXGRAPH
|
|||
GetComponent<VisualEffect>().outputEventReceived -= OnVFXOutputEvent_Received; |
|||
#endif
|
|||
} |
|||
|
|||
private void OnValidate() |
|||
{ |
|||
CacheEventName(); |
|||
} |
|||
|
|||
void CacheEventName() |
|||
{ |
|||
m_VFXEventID = Shader.PropertyToID(m_VFXEventName); |
|||
} |
|||
|
|||
#if PACKAGE_VFXGRAPH
|
|||
void OnVFXOutputEvent_Received(VFXOutputEventArgs args) |
|||
{ |
|||
if(args.nameId == m_VFXEventID) |
|||
{ |
|||
Callable.Call(onEventReceived, gameObject); |
|||
} |
|||
} |
|||
#endif
|
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 68ebf341e2a981b47b256be279fd4bf8 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {fileID: 2800000, guid: 9a14315cb05b557459e14128a03f988f, type: 3} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue