예제 #1
0
 private void Start()
 {
     vb = GetComponent <VehicleBase>();
     if (vb != null)
     {
         ObjectHeightOffset = vb.ObjectHeight;
     }
 }
예제 #2
0
 protected virtual void Start()
 {
     rb = GetComponent<Rigidbody>();
     vehicle = GetComponent<VehicleBase>();
     if (rb) {
         startDrag = rb.drag;
         startAngularDrag = rb.angularDrag;
         rb.mass = mass;
     }
 }
예제 #3
0
 protected virtual void HandleControlTarget()
 {
     if (controlTarget != previousControlTarget)
     {
         //new controlTarget has been set- update everyone
         if (previousControlTarget)
         {
             previousControlTarget.RemoveController(this);
         }
         controlTarget.SetController(this);
         previousControlTarget = controlTarget;
     }
 }
예제 #4
0
        // Update is called once per frame
        void Update()
        {
            vehicle = controller.ControlTarget;
            if (vehicle != null)
            {
                LatLon geoPos        = vehicle.GetGeoPos();
                float  TerrainHeight = GeoCoord.GetTerrainElevation(geoPos);
                tmpPosition.text = ("LatLonHeight: (" + Mathf.Round(geoPos.lat * 10f) / 10f + "," + Mathf.Round(geoPos.lon * 10f) / 10f + "," + Mathf.Round(TerrainHeight * 100f) / 100f) + ")";

                /*
                 * tmpGravity.text = ("Gravity: " + Mathf.Round(vehicle.GetGravitationalForce() * 100f) / 100f);
                 *
                 * tmpHeight.text = ("Height: " + Mathf.Round(vehicle.GetHeight() * 100f) / 100f);
                 *
                 * tmpTemp.text = ("Temp: " + Mathf.Round(vehicle.GetAirDensity() * 1000f) / 1000f);
                 *
                 * tmpLift.text = ("Lift: " + Mathf.Round(vehicle.GetLiftForce() * 100f) / 100f);
                 */
            }
        }
예제 #5
0
 // Use this for initialization
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     vb = GetComponent <VehicleBase>();
 }