Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
Created October 8, 2015 06:03
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 naojitaniguchi/ae456d9f49930835201c to your computer and use it in GitHub Desktop.
Save naojitaniguchi/ae456d9f49930835201c to your computer and use it in GitHub Desktop.
Unity Script for set render queue , this script works at editor mode .
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class SetRenderQueue : MonoBehaviour {
public int rQueue;
// Use this for initialization
void Start () {
GetComponent<Renderer>().material.renderQueue = rQueue;
Transform trans = transform;
for (int i = 0; i < trans.childCount; i++)
{
transform.GetChild(i).gameObject.GetComponent<Renderer>().material.renderQueue = rQueue;
}
}
// Update is called once per frame
void Update () {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment