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 不是完全按时设定的来,是尽量接近。

相关推荐
jtymyxmz9 小时前
《Unity Shader》10.1.4 折射
unity·游戏引擎
在路上看风景10 小时前
12. Burst
unity
平行云PVT12 小时前
实时云渲染解决UE5 像素流插件迁移及传输数据受限问题
unity·ue5·xr·实时云渲染·云桌面·像素流·云推流
熬夜敲代码的小N15 小时前
Unity WebRequest高级操作:构建高效稳定的网络通信模块
android·数据结构·unity·游戏引擎
萘柰奈15 小时前
Unity【小问题】----URP项目中加载AssetBundle中的预设体即使加载了依赖的材质依然是紫色的问题
unity·游戏引擎·材质
wonder1357917 小时前
UGUI合批分析和优化方法整理
unity·ugui
海中有金18 小时前
Unreal Engine 线程模型深度解析[2]
人工智能·游戏引擎·虚幻
海中有金18 小时前
Unreal Engine 内存池浅谈[11]——总结篇
游戏引擎·虚幻
wonder1357919 小时前
UGUI鼠标点击到按钮响应流程的源码分析
unity·ugui
熊猫悟道1 天前
Unity shader 之,Shader内部时间离散处理
unity·游戏引擎·材质·着色器