Unity3d Time

using UnityEngine;
using System.Collections;

public class test1 : MonoBehaviour {
    public float angleSpeed;
    void Update () {
        if(Input.GetKeyDown(KeyCode.UpArrow))
        {
            float sumTime = Time.time;
            print("从游戏开始到当前帧所消耗的总时长:" + sumTime.ToString());

            float deltaTime = Time.deltaTime;
            print("两帧之间的时间间隔:" + deltaTime.ToString());
        }

        //让游戏当前对象每秒中准确的旋转30度
        transform.Rotate(Vector3.up, Time.deltaTime * angleSpeed);

        //时间流逝的快慢
        float ts = Time.timeScale;
    }
}

 

posted @ 2016-07-19 22:21  吴筱军  阅读(209)  评论(0编辑  收藏  举报