Last active
January 11, 2016 11:40
-
-
Save sehm/b5b7fe53f32fc67e37d8 to your computer and use it in GitHub Desktop.
Unity Editor スクリプト: SortingLayer 名を取得する
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; | |
using UnityEditor; | |
{ | |
// SortingLayer 名の取得 | |
var tagManager = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/TagManager.asset")[0]); | |
var sortingLayer = tagManager.FindProperty("m_SortingLayers"); | |
for (int i = 0; i < sortingLayer.arraySize; ++i) { | |
string tag = sortingLayer.GetArrayElementAtIndex(i).displayName; | |
// TODO : | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment