Example #1
0
        /// <summary></summary>
        /// <param name="effectName"></param>
        /// <param name="loadResources">Load all required resources?</param>
        /// <returns>The specified particle effect, or null if failed.</returns>
        public static ParticleEffect Get(string effectName, bool loadResources = true)
        {
            var effectHandle = ParticleEffectInterop.FindEffect(effectName, loadResources);

            if (effectHandle == IntPtr.Zero)
            {
                return(null);
            }

            return(TryGet(effectHandle));
        }
Example #2
0
        public ParticleEffect GetChild(int index)
        {
            var childHandle = ParticleEffectInterop.GetChild(Handle, index);

            return(TryGet(childHandle));
        }
Example #3
0
 public void LoadResources()
 {
     ParticleEffectInterop.LoadResoruces(Handle);
 }
Example #4
0
 public void Remove()
 {
     ParticleEffectInterop.Remove(Handle);
 }
Example #5
0
 /// <summary>
 /// Spawns this effect
 /// </summary>
 /// <param name="independent"></param>
 /// <param name="pos">World location to place emitter at.</param>
 /// <param name="dir">World rotation of emitter, set to Vec3.Up if null.</param>
 /// <param name="scale">Scale of the emitter.</param>
 public ParticleEmitter Spawn(Vector3 pos, Vector3?dir = null, float scale = 1f, bool independent = true)
 {
     return(ParticleEmitter.TryGet(ParticleEffectInterop.Spawn(Handle, independent, pos, dir ?? Vector3.Up, scale)));
 }