示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (Application.loadedLevelName == "Scene" || Application.loadedLevelName == "Tutorial") {
         attractor = GameObject.Find("Planet").GetComponent<FauxGravityAttractor>();
         this.GetComponent<Rigidbody>().useGravity = false;
         attractor.attract (myTransform);
     } else {
         this.GetComponent<Rigidbody>().useGravity = true;
     }
 }