using System.Collections; using System.Collections.Generic; using UnityEngine; public class EffectRenderSort : MonoBehaviour { [SerializeField] int m_RendererOrder; Renderer m_Renderer; new Renderer renderer { get { return m_Renderer ?? (m_Renderer = this.GetComponent()); } } private void OnEnable() { if (renderer!=null) { renderer.sortingOrder = m_RendererOrder; } } }