예제 #1
0
 // Update is called once per frame
 void Update()
 {
     /*
      *  Instead of this if condition, we need following conditions to be satiesfied
      *  1. value from keypad = 0, then do nothing
      *  2. value from keypad = 1, 2, 3 then store it int mode and pass it
      *  3. value from keypad other than 1, 2, 3 then do nothing
      */
     if (Input.GetKeyDown(KeyCode.C))
     {
         int mode = 2;
         cameraControl.ChangeMode(mode);
     }
 }
예제 #2
0
        private void FixedUpdate()
        {
            // pass the input to the car!
            //Close old codes which created by unity team
            //float h = CrossPlatformInputManager.GetAxis("Horizontal");
            //float v = CrossPlatformInputManager.GetAxis("Vertical");
            if (mode == 1 || mode == 2 || mode == 3)
            {
                cameraControl.ChangeMode(mode);
            }

#if !MOBILE_INPUT
            float handbrake = CrossPlatformInputManager.GetAxis("Jump");
            m_Car.Move(-h, v, v, handbrake);
#else
            m_Car.Move(h, v, v, 0f);
#endif
        }