Last active
April 22, 2020 15:48
-
-
Save Manamongods/61f25f8c38d090292151993f56f3fc20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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