Last active
August 29, 2015 14:07
-
-
Save tsubaki/299d844d70e6636a3b7d to your computer and use it in GitHub Desktop.
Input.GetAxisとCrossPlatformInputManager.GetAxis
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 UnityEngine; | |
using System.Collections; | |
using UnitySampleAssets.CrossPlatformInput; | |
public class CrossPlatformMoveSphere : MonoBehaviour | |
{ | |
void Update () | |
{ | |
// あふたー | |
var axis = CrossPlatformInputManager.GetAxis("Horizontal"); | |
transform.position += Vector3.right * axis * Time.deltaTime; | |
} | |
} |
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 UnityEngine; | |
public class MoveSphere : MonoBehaviour | |
{ | |
void Update () | |
{ | |
// びふぉあー | |
var axis = Input.GetAxis("Horizontal"); | |
transform.position += Vector3.right * axis * Time.deltaTime; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment