You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
using System;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
using UnityEngine.VFX;
|
|
|
|
namespace UnityEditor.VFX
|
|
{
|
|
class LaunchEventBehavior : IPushButtonBehavior
|
|
{
|
|
public void OnClicked(string value)
|
|
{
|
|
var allComponent = UnityEngine.VFX.VFXManager.GetComponents();
|
|
foreach (var component in allComponent)
|
|
{
|
|
component.SendEvent(value);
|
|
}
|
|
}
|
|
}
|
|
|
|
[VFXHelpURL("Context-Event")]
|
|
[VFXInfo(name = "Event", category = "Event")]
|
|
class VFXBasicEvent : VFXContext
|
|
{
|
|
[VFXSetting, PushButton(typeof(LaunchEventBehavior), "Send"), Delayed]
|
|
public string eventName = VisualEffectAsset.PlayEventName;
|
|
|
|
public VFXBasicEvent() : base(VFXContextType.Event, VFXDataType.None, VFXDataType.SpawnEvent) { }
|
|
public override string name { get { return "Event"; } }
|
|
|
|
public override VFXExpressionMapper GetExpressionMapper(VFXDeviceTarget target)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public override bool CanBeCompiled()
|
|
{
|
|
return outputContexts.Any(c => c.CanBeCompiled());
|
|
}
|
|
}
|
|
}
|