How to Rotate the GUI button on its own axis.

I want my GUI buttons to rotate on its own axis.
I have added a few line of code to it.but not getting the rotation in the way I want.
its rotating around the pivot defined by me.Is there any way so that it can rotate on its own axis and nothing gameobjects rotate using transform.Rotate on a particular axis.

here is my code:

using UnityEngine;
using System.Collections;

public class Menu111 : MonoBehaviour {

private float rotAngle = 0;
private Vector2 pivotPoint;
public GUISkin MenuSkin;
bool isrotating = false;
// Use this for initialization
void Start () {


// Update is called once per frame
void Update () {
	rotAngle += 1;

void OnGUI(){ = MenuSkin;
	pivotPoint = new Vector2(Screen.width / 2, Screen.height / 2);
    GUIUtility.RotateAroundPivot(rotAngle, pivotPoint);
    if (GUI.Button(new Rect(Screen.width / 2 - 25, Screen.height / 2 - 25, 128, 128), "Rotate"))
        isrotating = true;


You need to get the center of your GUI object in order to rotate it around its own axle.
This code should make the object to rotate it in the middle of the GUI object:

float rotationAngle = 0.0f;
void OnGUI()
Rect guiRect = new Rect(Screen.width / 2.0f, Screen.height / 2.0f, 128.0f, 128.0f);
float xValue = ((guiRect.x + guiRect.width / 2.0f));
float yValue = ((guiRect.y + guiRect.height / 2.0f));
Vector2 Pivot = new Vector2(xValue, yValue);
GUIUtility.RotateAroundPivot(rotationAngle, Pivot);
GUI.Button(guiRect, "Test button");
GUI.matrix = Matrix4x4.identity;

And don’t forget to reset the matrix after you are done.