浏览代码

Added OnVFXOutputEvent / Fixes for VFX Actions / Added AssemblyInfo Defines

/feature-on-vfx-output-event
Thomas ICHÉ 3 年前
当前提交
8b84168d
共有 8 个文件被更改,包括 152 次插入11 次删除
  1. 3
      Editor/PropertyDrawers/CallableReorderableList.cs
  2. 42
      Icons/Misc/ic-vfx.png
  3. 5
      Runtime/GameplayIngredients.asmdef
  4. 1
      Runtime/GameplayIngredients.cs
  5. 19
      Runtime/LevelScripting/Actions/VFXSendEventAction.cs
  6. 20
      Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs
  7. 62
      Runtime/LevelScripting/Events/OnVFXOutputEvent.cs
  8. 11
      Runtime/LevelScripting/Events/OnVFXOutputEvent.cs.meta

3
Editor/PropertyDrawers/CallableReorderableList.cs


using UnityEditor;
using UnityEditorInternal;
using System.Linq;
using System.Reflection;
namespace GameplayIngredients.Editor
{

{
public static void AddCallable(this GameObject gameObject, Component component, string propertyName, System.Type t)
{
var field = component.GetType().GetFields().Where(f => f.Name == propertyName).FirstOrDefault();
var field = component.GetType().GetFields(BindingFlags.Public| BindingFlags.Instance | BindingFlags.NonPublic).Where(f => f.Name == propertyName).FirstOrDefault();
var val = field.GetValue(component) as Callable[];
if (t != null && typeof(Callable).IsAssignableFrom(t))

42
Icons/Misc/ic-vfx.png

之前 之后
宽度: 32  |  高度: 32  |  大小: 2.8 KiB

5
Runtime/GameplayIngredients.asmdef


"name": "com.unity.modules.screencapture",
"expression": "1.0.0",
"define": "MODULE_SCREENCAPTURE"
},
{
"name": "com.unity.visualeffectgraph",
"expression": "10.0.0",
"define": "PACKAGE_VFXGRAPH"
}
],
"noEngineReferences": false

1
Runtime/GameplayIngredients.cs


public const string rigsPath = basePath + "Rigs/";
public const string timerPath = basePath + "Timers/";
public const string stateMachinePath = basePath + "State Machines/";
public const string vfxPath = basePath + "VFX/";
}

19
Runtime/LevelScripting/Actions/VFXSendEventAction.cs


using UnityEngine;
#if PACKAGE_VFXGRAPH
#endif
[AddComponentMenu(ComponentMenu.actionsPath + "VFX Send Event Action")]
[Callable("Game", "Misc/ic-vfx.png")]
#if !PACKAGE_VFXGRAPH
[WarnDisabledModule("Visual Effect Graph")]
#endif
[AddComponentMenu(ComponentMenu.vfxPath + "VFX Send Event Action")]
[Callable("Visual Effects", "Misc/ic-vfx.png")]
#if PACKAGE_VFXGRAPH
[NonNullCheck]
#endif
#if PACKAGE_VFXGRAPH
var attrib = visualEffect.CreateVFXEventAttribute();
visualEffect.SendEvent(eventName, attrib);
visualEffect?.SendEvent(eventName);
#else
Debug.LogWarning("VFXSendEventAction 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
}
public override string GetDefaultName()

20
Runtime/LevelScripting/Actions/VFXSetPropertyAction.cs


using UnityEngine;
#if PACKAGE_VFXGRAPH
#endif
[AddComponentMenu(ComponentMenu.actionsPath + "VFX Set Property Action")]
[Callable("Game", "Misc/ic-vfx.png")]
#if !PACKAGE_VFXGRAPH
[WarnDisabledModule("Visual Effect Graph")]
#endif