unity设置帧率

cs 复制代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Run : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("hello unity");

        Application.targetFrameRate = 100;

    }

    // Update is called once per frame
    void Update()
    {
        Debug.Log(Time.time);
        print("---------------------------");
        Debug.Log(Time.deltaTime);


    }
}

Time.time当前时间

Time.deltaTime固定的与上一帧的时间

Application.targetFrameRate = 100;设置运行的帧率一秒运行多少次

Time.deltaTime 约等于1/ Application.targetFrameRate 不是完全按时设定的来,是尽量接近。

相关推荐
玉梅小洋1 小时前
Unity Muse 完整使用文档:Sprite+Texture专项
unity·ai·游戏引擎
能源革命3 小时前
Three.js、Unity、Cesium对比分析
开发语言·javascript·unity
timathy331 天前
Unity Addressable 实现Build时自定义剔除资源组
unity·游戏引擎
一种时光2 天前
Unity 获取当前播放的动画,判断是否是某个动画
unity·游戏引擎
速冻鱼Kiel2 天前
Lyra的相机系统
笔记·ue5·游戏引擎·虚幻
不绝1912 天前
Unity入门 :场景叠加/预制体资源包/脚本资源/生命周期函数/Inspector页面
unity·游戏引擎
在路上看风景2 天前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手2 天前
unity对象池
unity·c#
在路上看风景2 天前
3.7 SRP Batcher
unity
快乐觉主吖2 天前
Unity方便修改产品名和包名的小工具
unity·游戏引擎