示例#1
0
        private void FixedUpdate()
        {
            float h = CrossPlatformInputManager.GetAxis("Horizontal2");
            float v = CrossPlatformInputManager.GetAxis("Vertical2");

            float handbrake = CrossPlatformInputManager.GetAxis("Jump2");

            m_Car.Move(h, v, v, handbrake);
            AnalogueSpeedConverter2.ShowSpeed(rb.velocity.magnitude, 0, 80);
        }
    // Update is called once per frame
    void Update()
    {
        float translation = Input.GetAxis("Vertical") * speed;
        float rotation    = Input.GetAxis("Horizontal") * rotationSpeed;

        translation *= Time.deltaTime;
        rotation    *= Time.deltaTime;
        rb.AddForce(this.transform.forward * translation * 40);
        rb.AddTorque(this.transform.up * rotation * 15);

        AnalogueSpeedConverter.ShowSpeed(rb.velocity.magnitude, 0, 80);

        AnalogueSpeedConverter2.ShowSpeed(rb.velocity.magnitude, 0, 25);
    }
示例#3
0
 // Use this for initialization
 void Start()
 {
     thisSpeed = this;
 }