Skip to content

Instantly share code, notes, and snippets.

@Manamongods
Last active April 22, 2020 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Manamongods/61f25f8c38d090292151993f56f3fc20 to your computer and use it in GitHub Desktop.
Save Manamongods/61f25f8c38d090292151993f56f3fc20 to your computer and use it in GitHub Desktop.
//Steffen Vetne made this
//Creative Commons 0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NonLoopingParticles : MonoBehaviour
{
#if UNITY_EDITOR
private void OnValidate()
{
var m = GetComponent<ParticleSystem>().main;
if (m.playOnAwake)
m.playOnAwake = false;
}
#endif
private void Awake()
{
var m = GetComponent<ParticleSystem>().main;
m.loop = false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment