首页 > 编程语言 > 详细

Unity3d Time

时间:2016-07-19 23:22:25      阅读:115      评论:0      收藏:0      [点我收藏+]
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;
    }
}

 

Unity3d Time

原文:http://www.cnblogs.com/wrbxdj/p/5686476.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!