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

相关推荐
EQ-雪梨蛋花汤2 小时前
【Unity笔记】Unity 编辑器扩展:打造一个可切换 Config.assets 的顶部菜单插件
unity·编辑器·游戏引擎
SmalBox3 小时前
【URP】UnityHLSL顶点片元语义详解
unity·渲染
在路上看风景14 小时前
9. Mono项目与Unity的关系
unity
在路上看风景15 小时前
1.12 Memory Profiler Package - Summary
unity
SmalBox20 小时前
【URP】Unity Shader Tags
unity·渲染
极客柒1 天前
Unity 塔防自用可视化路点寻路编辑器
unity·编辑器·游戏引擎
程序猿多布1 天前
Unity AssetBundle详解
unity·assetbundle
萘柰奈1 天前
Unity学习----【进阶】Addressables(二)--加载资源与打包及更新
学习·unity
lvcoc2 天前
unity 接入火山引擎API,包括即梦AI
windows·unity·ai·火山引擎
一线灵2 天前
跨平台游戏引擎 Axmol-2.8.1 发布
junit·游戏引擎