Created
October 23, 2017 12:27
-
-
Save tsubaki/39c66b574e080427869e2a148526cf3d to your computer and use it in GitHub Desktop.
Cinemachineのコントローラーの向きを逆にする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class CinemachineCustomAxis : MonoBehaviour | |
{ | |
public bool xInversion, yInversion; | |
void Start () | |
{ | |
Cinemachine.CinemachineCore.GetInputAxis = GetAxisCustom; | |
} | |
public float GetAxisCustom(string axisName) | |
{ | |
if(axisName == "Mouse X") | |
{ | |
return Input.GetAxis(axisName) * (xInversion? -1f : 1f); | |
} | |
else if (axisName == "Mouse Y") | |
{ | |
return Input.GetAxis(axisName) * (yInversion? -1 : 1); | |
} | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://forum.unity.com/threads/overriding-freecamera-cinemachine-inputs-or-freecamera-axis-inversion.484819/