static internal VFXEventAttribute Internal_InstanciateVFXEventAttribute(VisualEffectAsset vfxAsset) { var eventAttribute = new VFXEventAttribute(Internal_Create(), true); eventAttribute.Internal_InitFromAsset(vfxAsset); return(eventAttribute); }
private void CheckValidVFXEventAttribute(VFXEventAttribute eventAttribute) { if (eventAttribute != null && eventAttribute.vfxAsset != visualEffectAsset) { throw new InvalidOperationException("Invalid VFXEventAttribute provided to VisualEffect, has been created with another VisualEffectAsset"); } }
protected override void OnUpdate() { var toBeDestroyedEntities = m_DestroyGroup.GetEntityArraySt(); for (int i = 0; i < toBeDestroyedEntities.Length; ++i) { var toBeDestroyedEntity = toBeDestroyedEntities[i]; var tr = EntityManager.GetComponentObject <UnityEngine.Transform>(toBeDestroyedEntity); if (tr != null) { if (vfxGo == null) { vfxGo = new UnityEngine.GameObject("VfxGameObject"); vfx = vfxGo.AddComponent <UnityEngine.Experimental.VFX.VisualEffect>(); var grenadeClient = tr.GetComponent <GrenadeClient>(); vfx.visualEffectAsset = grenadeClient.explodeEffect.effect; vfxEventAttribute = vfx.CreateVFXEventAttribute(); } vfxEventAttribute.SetVector3(positionID, tr.position); vfx.Play(vfxEventAttribute); UnityEngine.Object.Destroy(tr.gameObject); } } }
public VFXEventAttribute(VFXEventAttribute original) { if (original == null) { throw new ArgumentNullException("VFXEventAttribute expect a non null attribute"); } m_Ptr = Internal_Create(); Internal_InitFromEventAttribute(original); }
public VFXEventAttribute CreateVFXEventAttribute() { if (visualEffectAsset == null) { return(null); } var vfxEventAttribute = VFXEventAttribute.Internal_InstanciateVFXEventAttribute(visualEffectAsset); return(vfxEventAttribute); }
public void Stop(VFXEventAttribute eventAttribute) { CheckValidVFXEventAttribute(eventAttribute); SendStop(eventAttribute); }
extern private void Internal_SendEvent(int eventNameID, VFXEventAttribute eventAttribute);
public void Play(VFXEventAttribute eventAttribute) { CheckValidVFXEventAttribute(eventAttribute); SendPlay(eventAttribute); }
extern internal void SendStop(VFXEventAttribute eventAttribute);
extern internal void Internal_InitFromEventAttribute(VFXEventAttribute vfxEventAttribute);
extern internal void SendPlay(VFXEventAttribute eventAttribute);
extern public void SendEvent(string eventName, VFXEventAttribute eventAttribute = null);
extern public void CopyValuesFrom([NotNull] VFXEventAttribute eventAttibute);
extern public void Play(VFXEventAttribute eventAttribute = null);
public void SendEvent(int eventNameID, VFXEventAttribute eventAttribute) { CheckValidVFXEventAttribute(eventAttribute); SendEventFromScript(eventNameID, eventAttribute); }
extern private void SendEventFromScript(int eventNameID, VFXEventAttribute eventAttribute);
public void Stop(VFXEventAttribute eventAttribute) { SendEvent(VisualEffectAsset.StopEventID, eventAttribute); }
public void Play(VFXEventAttribute eventAttribute) { SendEvent(VisualEffectAsset.PlayEventID, eventAttribute); }
extern public void Stop(VFXEventAttribute eventAttribute = null);
public void SendEvent(int eventNameID, VFXEventAttribute eventAttribute) { CheckValidVFXEventAttribute(eventAttribute); Internal_SendEvent(eventNameID, eventAttribute); }
public void SendEvent(string eventName, VFXEventAttribute eventAttribute) { SendEvent(Shader.PropertyToID(eventName), eventAttribute); }
extern public void SendEvent(int eventNameID, VFXEventAttribute eventAttribute);