Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEditor;
- public class LayerChanger : ScriptableObject
- {
- const string kLayerName = "Default";
- [MenuItem ("GameObject/Set selection layer to " + kLayerName)]
- static void Run ()
- {
- foreach (GameObject gameObject in Selection.gameObjects)
- {
- gameObject.layer = LayerMask.NameToLayer (kLayerName);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement