2016年11月18日 星期五

3D模型

using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {

Vector3[] T = new Vector3[4];
// Use this for initialization
void Start () {
T [0] = new Vector3 (70.84097f, 0, 106.4693f);
T [1] = new Vector3 (-82.8387f, 0, 69.9469f);
T [2] = new Vector3 (-97.1511f, 0, -97.5819f);
T [3] = new Vector3 (75.99023f, 0, -59.2781f);


}
int aa = 0;
// Update is called once per frame
void Update () {
transform.position = Vector3.MoveTowards (transform.position, T [aa], 20 * Time.deltaTime);
if (transform.position == T [aa])
aa = (aa + 1)% 4;

transform.Rotate(Vector3.up,100f*Time.deltaTime);
}
}

沒有留言:

張貼留言