//If gravity is enable, this transform will be attracted to the ground object in this scene.
 private void FixedUpdate()
 {
     if (enableGravity == true)
     {
         gravity.Attract(transform, allowRotation);
     }
 }
示例#2
0
 void FixedUpdate()
 {
     planet.Attract(transform);
 }