示例#1
0
    void LateUpdate()
    {
        Vector3 pos   = transform.position;
        Vector3 vel   = rigidbody.velocity;
        float   speed = Mathf.Pow(vel.x, 2) + Mathf.Pow(vel.y, 2) + Mathf.Pow(vel.z, 2);

        speed             = Mathf.Sqrt(speed) * 3.6f;
        altitudeText.text = Mathf.RoundToInt(pos.y).ToString();
        speedText.text    = Mathf.RoundToInt(speed).ToString();
        //speedText.text = Mathf.RoundToInt(vel.z).ToString();
        throttleText.text = Mathf.Round(physicsController.GetThrottle() * 100) + "%";

        Quaternion rot = transform.rotation;

        cameraTether.transform.position = pos;
        cameraTether.transform.rotation = rot;
    }
示例#2
0
文件: Plane.cs 项目: yaoya/FallenSky
 void Update()
 {
     jetSFXSource.volume = physicsController.GetThrottle() * 0.5f;
 }