[Closed][Duplicate] How to get Layers in scene via script

I am attempting to create a sprite tile mapper custom editor. And I want the user to be able to dictate what sorting layer he wants the sprite he is tiling into the scene. To do this effectively and make it as dynamic as possible I want it to be able to allow the user to select from a drop down list (the way a public enum works in the editor) from which layer he wants it to be in.

Is there any way to access how many layers there are, what the layer names are, the layer orders etc.

use EditorGUI.TagField

if want edit in code: manage tags in code

Turns out I’m a fool and this has already been answered two days ago.