Created
August 5, 2017 03:40
-
-
Save flushpot1125/fe5ed2a4f262de4e76d6f60626a3a64c to your computer and use it in GitHub Desktop.
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
private Vector3 GetCameraControlTranslation() | |
{ | |
InputDev inputDev = InputDev.Instance; | |
Vector3 deltaPosition = Vector3.zero; | |
//deltaPosition += GetKeyDir("left", "right") * Camera.main.transform.right; //ここをコメントアウトする | |
//deltaPosition += GetKeyDir("down", "up") * Camera.main.transform.forward; //ここをコメントアウトする | |
// Support fly up/down keypresses if the current project maps it. This isn't a standard | |
// Unity InputManager mapping, so it has to gracefully fail if unavailable. | |
if (this.isFlyKeypressEnabled) | |
{ | |
try | |
{ | |
deltaPosition += InputCurve(Input.GetAxis("Fly")) * m_Veil.transform.up; | |
} | |
catch (System.Exception) | |
{ | |
this.isFlyKeypressEnabled = false; | |
} | |
} | |
// All input should come through inputDev, someday | |
deltaPosition += InputCurve(inputDev.VirtualCamTranslate.delta.x) * this.transform.right; | |
deltaPosition += InputCurve(inputDev.VirtualCamTranslate.delta.y) * this.transform.forward; | |
deltaPosition += InputCurve(inputDev.VirtualCamVertAndRoll.delta.x) * this.transform.up; | |
float accel = Input.GetKey(KeyCode.LeftShift) ? 1.0f : 0.1f; | |
return accel * deltaPosition; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment