欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

unity3d怎么打代碼?

Unity3D中用代碼實(shí)現(xiàn)物體的左右循環(huán)移動(dòng)的方式如下: 1、新建一個(gè)Cube,在Cube X軸的正方向放置一個(gè)空物體或者其他GameObject,Cube和空物體的Y值一致,確保2者在同一水平線上; 2、把下列代碼保存為C#,賦給Cube,并在Inspector視圖中,把空物體賦到腳本的PointB中; using UnityEngine; using System.Collections; public class Moving : MonoBehaviour { public Transform PointB; private int _direction = 1; private float _pointA; // Use this for initialization IEnumerator Start () { _pointA = transform.position.x; while (true) { if (transform.position.x < _pointA) { _direction = 1; } if (transform.position.x > PointB.position.x) { _direction = -1; } transform.Translate(_direction * 2 * Time.deltaTime,0,0); yield return 0; } } }