I am working on an editor script and what I am trying to accomplish at the moment is making a button in the editor that when pressed rotates the selected object 90, -90, and 180 degrees. Each of them should be separate buttons. I have the buttons and they are accepted and work just great. The problem is I cant use Selection.transform.Rotate(0,0,0); for some reason.
My code:
if(GUILayout.Button("90"))
{
Selection.transform.Rotate(0,90,0);
}
if(GUILayout.Button("-90"))
{
}
if(GUILayout.Button("180"))
{
}
Error I receive. Assets/Editor/ObjectBuilderEditor.cs(43,35): error CS0117: UnityEditor.Selection' does not contain a definition for
transform’