Created
August 20, 2015 16:58
-
-
Save unitycoder/07bf7fc9af13740b7d28 to your computer and use it in GitHub Desktop.
SetSortingOrderAndLayer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class SetSortingOrderAndLayer : MonoBehaviour { | |
public int sortingOrder = 0; | |
public string layerName = "Default"; | |
void Awake() | |
{ | |
GetComponent<Renderer>().sortingOrder = sortingOrder; | |
GetComponent<Renderer>().sortingLayerName = layerName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment