Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Created October 23, 2017 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/39c66b574e080427869e2a148526cf3d to your computer and use it in GitHub Desktop.
Save tsubaki/39c66b574e080427869e2a148526cf3d to your computer and use it in GitHub Desktop.
Cinemachineのコントローラーの向きを逆にする
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