Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.SceneManagement;
  4.  
  5. public class CameraRotate : MonoBehaviour
  6. {
  7. public float speed;
  8. float time = 5.0f;
  9. public bool updateOn = true;
  10.  
  11. void Start()
  12. {
  13. StartCoroutine(updateOff());
  14. }
  15.  
  16. void Update()
  17. {
  18. if (updateOn == true)
  19. {
  20. if (time >= 0)
  21. {
  22. time -= Time.deltaTime;
  23. return;
  24. }
  25. else
  26. {
  27. transform.Rotate(0, speed * Time.deltaTime, 0);
  28. }
  29. }
  30. }
  31. IEnumerator updateOff()
  32. {
  33. yield return new WaitForSeconds(10.0f);
  34. updateOn = false;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement