16 lines
		
	
	
		
			367 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			16 lines
		
	
	
		
			367 B
		
	
	
	
		
			C#
		
	
	
	
|  | using UnityEngine; | |||
|  | 
 | |||
|  | [RequireComponent(typeof(ParticleSystem))] | |||
|  | public class ParticleSystemSortingOrder : MonoBehaviour { | |||
|  | 
 | |||
|  |     public int sortingOrder = 0; | |||
|  | 
 | |||
|  |     void Awake(){ | |||
|  |         GetComponent<ParticleSystemRenderer>().sortingOrder = sortingOrder; | |||
|  |     } | |||
|  | 
 | |||
|  |     void OnValidate(){ | |||
|  |         GetComponent<ParticleSystemRenderer>().sortingOrder = sortingOrder; | |||
|  |     } | |||
|  | } |