static internal VFXEventAttribute Internal_InstanciateVFXEventAttribute(VisualEffectAsset vfxAsset)
        {
            var eventAttribute = new VFXEventAttribute(Internal_Create(), true);

            eventAttribute.Internal_InitFromAsset(vfxAsset);
            return(eventAttribute);
        }
예제 #2
0
 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");
     }
 }
예제 #3
0
    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);
 }
예제 #5
0
        public VFXEventAttribute CreateVFXEventAttribute()
        {
            if (visualEffectAsset == null)
            {
                return(null);
            }
            var vfxEventAttribute = VFXEventAttribute.Internal_InstanciateVFXEventAttribute(visualEffectAsset);

            return(vfxEventAttribute);
        }
예제 #6
0
 public void Stop(VFXEventAttribute eventAttribute)
 {
     CheckValidVFXEventAttribute(eventAttribute);
     SendStop(eventAttribute);
 }
예제 #7
0
 extern private void Internal_SendEvent(int eventNameID, VFXEventAttribute eventAttribute);
예제 #8
0
 public void Play(VFXEventAttribute eventAttribute)
 {
     CheckValidVFXEventAttribute(eventAttribute);
     SendPlay(eventAttribute);
 }
예제 #9
0
 extern internal void SendStop(VFXEventAttribute eventAttribute);
 extern internal void Internal_InitFromEventAttribute(VFXEventAttribute vfxEventAttribute);
예제 #11
0
 extern internal void SendPlay(VFXEventAttribute eventAttribute);
예제 #12
0
 extern public void SendEvent(string eventName, VFXEventAttribute eventAttribute = null);
 extern public void CopyValuesFrom([NotNull] VFXEventAttribute eventAttibute);
예제 #14
0
 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);
 }
예제 #19
0
 extern public void Stop(VFXEventAttribute eventAttribute = null);
예제 #20
0
 public void SendEvent(int eventNameID, VFXEventAttribute eventAttribute)
 {
     CheckValidVFXEventAttribute(eventAttribute);
     Internal_SendEvent(eventNameID, eventAttribute);
 }
예제 #21
0
 public void SendEvent(string eventName, VFXEventAttribute eventAttribute)
 {
     SendEvent(Shader.PropertyToID(eventName), eventAttribute);
 }
 extern public void SendEvent(int eventNameID, VFXEventAttribute eventAttribute);