// Update is called once per frame
    void Update()
    {
        int x = (int)StreamSDK.GetAxis("Horizontal", id);
        int y = (int)StreamSDK.GetAxis("Vertical", id);

        transform.position = new Vector3(transform.position.x + x * speed * Time.deltaTime, transform.position.y + y * speed * Time.deltaTime, 0);
    }
예제 #2
0
        private void FixedUpdate()
        {
            //if( Input.GetKeyDown( KeyCode.R ) ) {
            if (StreamSDK.GetAxisDown("Reset", playerIndex))
            {
                transform.rotation = Quaternion.identity;
                transform.position = originalPosition;
            }

            // pass the input to the car!
            float h = StreamSDK.GetAxis("Horizontal", playerIndex);            //Input.GetAxis("Horizontal");
            float v = StreamSDK.GetAxis("Vertical", playerIndex);              //Input.GetAxis("Vertical");

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