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

相关推荐
mxwin3 小时前
次世代角色 PBR 贴图制作 + Unity URP 接入 极简流程图
unity·流程图·贴图·shader
mxwin4 小时前
Unity URP 法线贴图如何生成 用什么工具创建
unity·游戏引擎·贴图
mxwin15 小时前
Unity URP 法线贴图色彩空间、编码与解码
unity·游戏引擎·贴图·shader
玖玥拾17 小时前
Cocos学习笔记:项目框架搭建与异步加载进度
游戏引擎·cocos2d
mxwin18 小时前
Unity Shader URP:将法线可视化,便于调试
unity·游戏引擎·shader
蓝黑墨水18 小时前
unity相关链接
unity·游戏引擎
mxwin19 小时前
Unity Shader 法线贴图的七种错误用法
unity·游戏引擎·贴图·shader
mxwin21 小时前
Unity URP 切线空间详解
unity·游戏引擎·shader
caimouse1 天前
Godot Engine 最新版官方文档(简体中文完整翻译 & 精简梳理)
游戏引擎·godot
huizhixue-IT1 天前
Superpowers 游戏引擎从零开发实战指南
游戏引擎