E_ElecCompetition/Electrical_inspectionCompet.../Assets/Art/8.23/loadingBar/scripts/rotatetotate.cs

28 lines
651 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class rotatetotate : MonoBehaviour {
private RectTransform rectComponent;
private Image imageComp;
private bool up = false;
public float rotateSpeed = 200f;
// Use this for initialization
void Start () {
rectComponent = GetComponent<RectTransform>();
imageComp = rectComponent.GetComponent<Image>();
}
// Update is called once per frame
void Update () {
float currentSpeed = rotateSpeed * Time.deltaTime;
rectComponent.Rotate(0f, 0f, currentSpeed);
}
}