int time = 1; void Update() { time++; this.GetComponent<RectTransform>().rotation = Quaternion.Euler(0, 0, time); } void OnDestroy() { time = 0; }