You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
520 B

using UnityEngine;
using System.Collections;
namespace FogVolumeRenderPriority
{
[ExecuteInEditMode]
public class RenderPriority : MonoBehaviour {
public int DrawOrder = 0;
public bool UpdateRealTime = false;
// Use this for initialization
void OnEnable () {
gameObject.GetComponent<Renderer>().sortingOrder = DrawOrder;
}
// Update is called once per frame
void Update () {
if(UpdateRealTime)
gameObject.GetComponent<Renderer>().sortingOrder = DrawOrder;
}
}
}