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

相关推荐
avi91113 小时前
Unity Data Excel读取方法+踩坑记;和WPS Excel的一些命令
unity·游戏引擎·excel·wps·data
郁闷的网纹蟒4 小时前
虚幻5---第12部分---蒙太奇
开发语言·c++·ue5·游戏引擎·虚幻
天人合一peng5 小时前
Unity 中Canvas 或image打勾时不显示
unity
淡海水1 天前
【节点】[Houndstooth节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·houndstooth
微:xsooop2 天前
iOS上架被拒4.3(a) 10次到过审历程
flutter·unity·ios·uniapp
DoomGT2 天前
Physics Simulation - Hit Event的触发机制
ue5·游戏引擎·虚幻·虚幻引擎·unreal engine
jtymyxmz2 天前
《Unity Shader》14.1 卡通风格的渲染
unity·游戏引擎
天人合一peng2 天前
unity获得和修改button的text(TMP)
java·前端·unity
dzj20213 天前
Unity中使用LLMUnity遇到的问题(三)——如何配置和使用知识库
unity·llmunity·知识库大模型
Clank的游戏栈3 天前
Unity自动化美术资源校验工具(模型/材质规范检测)技术详解
unity·自动化·材质