YunCtrl.cs 482 B

12345678910111213141516171819202122
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class YunCtrl : MonoBehaviour
  5. {
  6. public int speed = 0;
  7. public int orientation = 0;
  8. //£¨4.7 £¬5.1£©
  9. private void Start()
  10. {
  11. speed = Random.Range(5, 15);
  12. orientation = Random.Range(0, 2) == 0 ? -1 : 1;
  13. }
  14. void Update()
  15. {
  16. transform.RotateAround(GameMgr.instance.transform.position, Vector3.up, speed * Time.deltaTime * orientation);
  17. }
  18. }