ParticleSpawner

ParticleSpawner#

NAMESPACE:

UnityUtils.ScriptUtils.Particles

The ParticleSpawner is used to easily play particle systems.

Example Usage#

using UnityEngine;
using UnityUtils.ScriptUtils.Particles;

public class ExampleScript : MonoBehaviour
{
     public GameObject particlePrefab;

     void Start()
     {
        // Spawn burst particles.
        ParticleSpawner.SpawnBurstParticles(particlePrefab, Vector3.zero);
     }
}

Functions#

UnityUtils.ScriptUtils.Particles.ParticleSpawner

Public Static Functions

void SpawnBurstParticle(GameObject particlePrefab, Vector3 position, Transform parent = null, Color color = default, Gradient gradient = default)#

Spawns a burst particle prefab at the given position Has adjustable color or gradient, but doesn’t need to be inputted.

Parameters:
  • particlePrefab – Particle system to spawn (Gameobject with particle system applied)

  • position – Position to spawn the particlePrefab at

  • parent – Parent to parent the prefab to on spawn

  • color – Color to set the particlePrefab to

  • gradient – Gradient to set the particlePrefab to