Skip to content

Instantly share code, notes, and snippets.

@sehm
Last active January 11, 2016 11:40
Show Gist options
  • Save sehm/b5b7fe53f32fc67e37d8 to your computer and use it in GitHub Desktop.
Save sehm/b5b7fe53f32fc67e37d8 to your computer and use it in GitHub Desktop.
Unity Editor スクリプト: SortingLayer 名を取得する
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