物体直线运动

来源:互联网 发布:网络机房运维方案 编辑:程序博客网 时间:2024/05/01 12:29
using UnityEngine;
using System.Collections;


public class Phy_1_1 : MonoBehaviour {


// Use this for initialization
public GameObject gameObj;
private int Speed;
void Start () {
gameObj.transform.position = Vector3.zero;
Speed = 10;
}

// Update is called once per frame
void Update () 
{
gameObj.transform.Translate(new Vector3(Speed*Time.deltaTime,0,0));
}


void FixedUpdate()
{

}
}
0 0
原创粉丝点击