示例#1
0
// --> Fixed Update function
    void FixedUpdate()
    {
        if (!carController.b_CarIsRespawning && !carController.b_CountdownActivate)             // --> car follow the path
        {
            CheckObstacles();                                                                   // Check obstacles
            TurnLeftAndRight();                                                                 // Turn car to the left or to the right if needed
            Acceleration();                                                                     // check acceleration
            CheckCarLocalVelocity();                                                            // check car velocity
        }
        else                                                                                    // --> car is respawing
        {
            if (carController.b_btn_Acce || carController.b_btn_Break)                          //
            {
                carController.Btn_AccelerationDeactivate();                                     // stop accelerartion or break
            }
        }
    }
示例#2
0
    public void OnPointerUpDelegate(PointerEventData data)
    {
        if (carController == null)
        {
            carController = grpInputs.carController;
        }

        if (btn_Left)
        {
            carController.Btn_LeftDeactivate();
        }
        if (btn_Right)
        {
            carController.Btn_RightDeactivate();
        }
        if (btn_Accelerate)
        {
            carController.Btn_AccelerationDeactivate();
        }
        if (btn_Break)
        {
            carController.Btn_BreakDeactivate();
        }
    }