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

相关推荐
雨泽‎5 小时前
Unity在URP中开启后处理导致RenderTexture存在背景
unity·游戏引擎·图形渲染
冒泡P12 小时前
【Unity】TextMeshPro富文本中使用精灵图集
ui·unity·c#·游戏引擎
世洋Blog12 小时前
开发思想-(数据驱动+组合模式)VS 继承
unity·组合模式·数据驱动
B0URNE14 小时前
【Unity基础详解】(9)Unity核心:UI系统
ui·unity·游戏引擎
jtymyxmz17 小时前
《Unity Shader》7.3 渐变纹理
unity·游戏引擎
ThreePointsHeat1 天前
Unity 关于打包WebGL + jslib录制RenderTexture画面
unity·c#·webgl
胡童嘉2 天前
长沙烈焰鸟网络科技有限公司实习day13日记
功能测试·学习·职场和发展·游戏引擎·cocos2d
y***54882 天前
C++在游戏引擎中的开发
开发语言·c++·游戏引擎
BuHuaX2 天前
Unity_AssetBundle相关
unity·c#·游戏引擎·游戏策划
神码编程2 天前
【Unity】 HTFramework框架(六十八)StringEditor字符串复杂编辑器
unity·编辑器·游戏引擎·htframework