Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class RotateConstant : MonoBehaviour {
- private bool pointerEnter;
- // Update is called once per frame
- void Update () {
- if (pointerEnter) {
- transform.Rotate(0, 0, 20 * Time.deltaTime); //rotates 20 degrees per second around z axis
- }
- }
- public void PointerEnter() {
- pointerEnter = true;
- }
- public void PointerExit() {
- pointerEnter = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement