2016年11月18日 星期五

========================================================================
using UnityEngine;
using System.Collections;

public class NewBehaviourScript : MonoBehaviour {
public float moveSpeed = 10f;
public float turnSpeed = 50f;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
transform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);
}
}
========================================================================
using UnityEngine;

public class NewBehaviourScript1 : MonoBehaviour {

// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// Rotate the object around its local X axis at 1 degree
transform.Rotate(10*Vector3.right * Time.deltaTime);
transform.Rotate(Vector3.up * Time.deltaTime,
Space.World);
}
}

沒有留言:

張貼留言