InputController.GetInput C# (CSharp) Méthode

GetInput() private méthode

private GetInput ( ) : Vector2
Résultat Vector2
    Vector2 GetInput()
    {
        #if UNITY_IOS || UNITY_ANDROID || UNITY_WP8 || UNITY_IPHONE
        return GetTouchInput();
        #else
        return GetKBInput();
        #endif
    }

Usage Example

Exemple #1
0
    void Update()
    {
        if (inputManager.HasInputs())
        {
            LeanLeft  = inputManager.GetInput("LeanLeft");
            LeanRight = inputManager.GetInput("LeanRight");
            ZoomKey   = inputManager.GetInput("Zoom");
        }

        LeanUpdate();

        if (zoomEnabled)
        {
            if (Input.GetKey(ZoomKey))
            {
                MainCamera.fieldOfView = Mathf.Lerp(MainCamera.fieldOfView, ZoomFOV, ZoomSpeed * Time.deltaTime);
                if (WeaponCamera)
                {
                    WeaponCamera.fieldOfView = Mathf.Lerp(MainCamera.fieldOfView, ZoomFOV, ZoomSpeed * Time.deltaTime);
                }
            }
            else
            {
                MainCamera.fieldOfView = Mathf.Lerp(MainCamera.fieldOfView, NormalFOV, ZoomSpeed * Time.deltaTime);
                if (WeaponCamera)
                {
                    WeaponCamera.fieldOfView = Mathf.Lerp(MainCamera.fieldOfView, NormalFOV, ZoomSpeed * Time.deltaTime);
                }
            }
        }
    }
All Usage Examples Of InputController::GetInput