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

相关推荐
weixin_424294671 小时前
对于未加入 Script Execution Order 的脚本
unity
暴走约伯1 小时前
【VFX工具链源码拆解 03】告别机械劳动(下):材质字典映射批处理与智能纹理槽识别
unity·游戏引擎·材质
Wanda12141 小时前
机器人与机电一体化3D数字孪生机器-Day9
人工智能·3d·unity·机器人·数字孪生
暴走约伯2 小时前
【VFX工具链源码拆解 01】总体架构:大型项目特效流程的程序化落地
开发语言·经验分享·3d·unity·架构·游戏引擎
Oiiouui21 小时前
Godot-GridGame架构DI容器全局联动设计
架构·游戏引擎·godot
平行云1 天前
建筑BIM/3D可视化轻量级实时评审与分享方案
unity·ue5·3dsmax·实时云渲染·云桌面·云游戏·建筑bim
2501_915106322 天前
Windows 上开发 Unity iOS,使用 KXBuild 进行真机调试、性能采样与打包 ipa
windows·vscode·unity·ios·个人开发·swift·敏捷流程
FFFFujige2 天前
【Unity】一个的Dots用Ruhanka踩坑记录
unity·游戏引擎
wgslucky2 天前
Godot UI管理与使用
游戏引擎·godot
Oiiouui3 天前
Godot-GridGame架构屏幕UI层
架构·游戏引擎·godot