Rotateobject.cs 361 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using System.Collections;
  3. public class Rotateobject : MonoBehaviour
  4. {
  5. public float speed;
  6. // Use this for initialization
  7. void Start ()
  8. {
  9. transform.Rotate(new Vector3(0, Random.Range(0.0f, 360.0f), 0));
  10. }
  11. // Update is called once per frame
  12. void Update ()
  13. {
  14. transform.Rotate(new Vector3(0, speed * Time.deltaTime, 0));
  15. }
  16. }