Exemple #1
0
    } // END - Player gun elevation.

    void PlayerChangeMode() {
        if(Input.GetButtonDown("P1_SwapCamera")) {
            v_InteriorPanels.SwapMainScreen();
            // Set Current Camera variable.
            if(go_CurrentCamera == v_ViewportCamera) { go_CurrentCamera = v_GunCamera; } else { go_CurrentCamera = v_ViewportCamera; }
        }// END IF input.

    } // END PlayerChangeMode.
    } // END - Player forward input.

//    void PlayerSteer()
//    {
//        float v_analogueInputValue = Input.GetAxis("P1_Steer");
//        Engine.Steering(v_analogueInputValue);
//    } // END - Player Steer input.

//    void PlayerBrake()
//    {
//        float v_analogueInputValue = Input.GetAxis("P1_Brake");
//        Engine.ApplyBraking(v_analogueInputValue);
//    } // END - Player brake input.

//    void PlayerTurretRotation()
//    {
//        //        Debug.Log(Input.mousePosition.x);
//        int ScreenWidthSegment = Screen.width / 2;
//        float v_MouseXPositionOnScreen = Input.mousePosition.x - Screen.width / 2;
//        float v_TurretRotation = Mathf.Clamp((v_MouseXPositionOnScreen / ScreenWidthSegment), -1, 1);
//
//        if (v_TurretRotation > 0 && v_TurretRotation > v_TurretInputDeadZone)
//        {
//            Engine.TurretRotation(v_TurretRotation);
//        }
//        else if (v_TurretRotation < 0 && v_TurretRotation < v_TurretInputDeadZone)
//        {
//            Engine.TurretRotation(v_TurretRotation);
//        } // END - Player Turret Rotation
//    } // END player turret rotation input.
//


//    void PlayerGunElevation()
//    {
//        // Divide screen height to get center:
//        int ScreenHeightSegment = Screen.height / 2;
//        // Get mouse position FROM center:
//        float v_mouseYPosition = Input.mousePosition.y - Screen.height / 2;
//        // Set variable to single digit value/percentage (to obtain 0-1).
//        float v_GunElevationInput = Mathf.Clamp((v_mouseYPosition / ScreenHeightSegment), -1, 1);
//        // CLAMP values to -1 - 1:
//
//        if (v_GunElevationInput > 0 && v_GunElevationInput > v_GunElevationInputDeadzone)
//        {
//            // Positive-Up.
//            Engine.GunElevation(v_GunElevationInput);
//        } // END if gun elevation Greater than 0 AND greater than deadzone..
//        else if (v_GunElevationInput < 0 && v_GunElevationInput < v_GunElevationInputDeadzone)
//        {
//            // Negative - Down.
//            Engine.GunElevation(v_GunElevationInput);
//        } // END - Else IF: gun elevation LESS than 0 AND greater than deadzone.
//
//    } // END - Player gun elevation.

    void PlayerChangeMode()
    {
        if (Input.GetKeyDown("mouse 1"))
        {
            v_InteriorPanels.SwapMainScreen();
            //    v_CurrentCamera++;
            //    if(v_CurrentCamera == v_CameraPositions.Length) { v_CurrentCamera = 0; }
            //    v_PlayerCamera.transform.localPosition = v_CameraPositions[v_CurrentCamera].transform.localPosition;
        }// END IF input.

    } // END PlayerChangeMode.