zoukankan      html  css  js  c++  java
  • time、deltaTime、fixedTime、fixedDeltatime的区别

    time是从程序开始执行到现在的时间,deltaTime上一帧完成的时间,fixedTime表示FixedUpdate已经执行的时间,而fixedDeltatime是一个固定的时间增量。

    在update()中time、deltaTime获取的是一个正确的值,fixedTime的值并不会增加,如果是在FixedUpdate

    中,则fixedTime值会更新并且和time的值一样,deltaTime和fixedDeltatime的值一样。注意除了fixedDeltatime其他3个值都是只读的,可以通过fixedDeltatime来改变FixedUpdate的跟新速率。

    void Update () {
            Debug.Log("在Update中执行");
            Debug.Log("time:"+Time.time);
            Debug.Log("deltatime"+Time.deltaTime);
            Debug.Log("fixedtime:"+Time.fixedTime);
            Debug.Log("fixedDeltatimetime:" + Time.fixedDeltaTime); 
    }
        void FixedUpdate()
        {
            Debug.Log("在fixedUpdate中执行");
            Debug.Log("time:" + Time.time);
            Debug.Log("deltatime" + Time.deltaTime);
            Debug.Log("fixedtime:" + Time.fixedTime);
            Debug.Log("fixedDeltatimetime:" + Time.fixedDeltaTime); 
        }

  • 相关阅读:
    Ansible运维自动化(配置管理工具)
    Haproxy 概述及搭建
    Hadoop 单机与完全分布式配置
    大数据与Hadoop
    Hadoop 高可用
    kafka原理和集群
    zookeeper原理及搭建
    个人记录点滴
    Java中导入Excel文件
    反射相关
  • 原文地址:https://www.cnblogs.com/wanggang550/p/6266802.html
Copyright © 2011-2022 走看看