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

相关推荐
syker1 小时前
3D游戏引擎Bluely Engine 开发手册
开发语言·3d·游戏引擎
Longyugxq13 小时前
Untiy的Webgl端网页端视频播放,又不想直接mp4格式等格式的。
unity·音视频·webgl
avi911115 小时前
Unity毛玻璃渲染模糊渲染Shader数学入门
unity·aigc·图形学·shader·hlsl
微光守望者16 小时前
Unity小知识【1】:刚体(Rigidbody)与碰撞器(Collider)的区别,你真的清楚吗?
unity·游戏引擎
孟无岐17 小时前
【Laya】Byte 二进制数据处理
网络·typescript·游戏引擎·游戏程序·laya
孟无岐19 小时前
【Laya】ClassUtils 类反射工具
typescript·游戏引擎·游戏程序·laya
June bug21 小时前
【配环境】unity项目开发环境
unity·游戏引擎
JQLvopkk1 天前
C#调用Unity实现设备仿真开发浅述
开发语言·unity·c#
秦奈1 天前
Unity复习学习笔记(九):UGUI
笔记·学习·unity
李尚朋20211 天前
搜嗖工具箱|小众有个性的趣味网站合集
深度学习·搜索引擎·游戏引擎