Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created January 7, 2014 06:55
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 hisasann/8295608 to your computer and use it in GitHub Desktop.
Save hisasann/8295608 to your computer and use it in GitHub Desktop.
レンダリングする順番を調整する
using UnityEngine;
using System.Collections;
[AddComponentMenu("Custom/Scripts/Render/RenderQueueChildren")]
public class RenderQueueChildren : MonoBehaviour
{
public int queue = 1;
// Use this for initialization
void Start ()
{
for (var i = 0; i < gameObject.transform.childCount; ++i) {
GameObject child = gameObject.transform.GetChild (i).gameObject;
if (!child.renderer) {
continue;
}
child.renderer.material.renderQueue += queue;
}
}
// 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