Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active August 29, 2015 14:07
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/299d844d70e6636a3b7d to your computer and use it in GitHub Desktop.
Save tsubaki/299d844d70e6636a3b7d to your computer and use it in GitHub Desktop.
Input.GetAxisとCrossPlatformInputManager.GetAxis
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;
}
}
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