标签:obj cto void nbsp tar horizon 移动 this class
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour {
Transform _player;
// Use this for initialization
void Start () {
_player = GameObject.Find("Sphere").transform;
}
// Update is called once per frame
void Update () {
float horizon = Input.GetAxis("Horizontal"); //获得horizontal
_player.transform.Translate(Vector3.right*horizon);
}
}
标签:obj cto void nbsp tar horizon 移动 this class
原文地址:http://www.cnblogs.com/wanggonglei/p/7763484.html