Skip to content

Instantly share code, notes, and snippets.

@nabesi777
Created October 4, 2018 07:58
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 nabesi777/b83b2611af2eb26dfa7be14033aa812f to your computer and use it in GitHub Desktop.
Save nabesi777/b83b2611af2eb26dfa7be14033aa812f to your computer and use it in GitHub Desktop.
BlueToothコントローラー動作テストスクリプト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Controll : MonoBehaviour {
// Use this for initialization
void Start () {
//スマホ画面上のXボタンを押すとアプリが終了
Input.backButtonLeavesApp = true;
}
// Update is called once per frame
void Update () {
if (Input.GetButton("Fire1")) //Xボタンが割り当て
{//動作テストの為にCubeを回転させる
transform.Rotate(transform.rotation.eulerAngles + new Vector3(0f, 0.0f, 0.1f));
}
//左スティックでCubeの移動
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");
transform.position += new Vector3(h*0.1f, v * 0.1f, 0f);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment