using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SelfRotate : MonoBehaviour {

    public float speed = 1;

    public Vector3 axis = Vector3.back;

    float angle = 0;

    public bool worldRotate = true;

	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {

        if(worldRotate)
            transform.RotateAround(transform.position,axis, speed );
        else
            transform.RotateAround(transform.position, transform.TransformDirection(axis).normalized, speed);
    }
}
