暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

SpinLoad.cs 431B

12345678910111213141516
  1. using UnityEngine;
  2. public class SpinLoad : MonoBehaviour
  3. {
  4. public bool active = false;
  5. Vector3 rand1, rand2;
  6. void Update()
  7. {
  8. if (!active)
  9. return;
  10. rand1 = new Vector3(Random.Range(-1, 1), Random.Range(-1, 1), Random.Range(-1, 1));
  11. rand2 = new Vector3(Random.Range(-1, 1), Random.Range(-1, 1), Random.Range(-1, 1));
  12. transform.Rotate(Vector3.Cross(rand1, rand2));
  13. }
  14. }