1 using UnityEngine;
2 using
System.Collections;
3
4 public
class OrbitalVelocity : MonoBehaviour {
5
6     
public float speed;
7
8     
// Use this for initialization
9     
void Start () {
10     
11     }
12     
13     
// Update is called once per frame
14     
void Update () {
15         Vector3 orbitalDirection = Quaternion.Euler (
0, 90, 0) * transform.GetComponent<Gravitate> ().mainGravityDirection;
16     
17         transform.GetComponent<Rigidbody> ().AddForce (orbitalDirection * speed);
18
19     }
20 }


Gõ tìm kiếm nhanh...