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

相关推荐
龙智DevSecOps解决方案41 分钟前
3A 游戏优化技术栈:如何打通引擎级分析工具与 DevOps 持续集成管线?
unity·性能优化·游戏开发·技术美术·perforce·unrealengine
葛兰岱尔2 小时前
从 SolidWorks 到 Three.js,从 Inventor 到 Unity——制造业CAD模型“几何-语义一体化“转换,不再是天方夜谭!
开发语言·javascript·unity
鼎艺创新科技4 小时前
三维电子沙盘中OSGB倾斜摄影数据的加载与渲染
游戏引擎·cocos2d
玉夏5 小时前
【Shader基础】UV 与纹理采样 Part1
unity·着色器·uv
kyle~5 小时前
Godot开源游戏引擎
开源·游戏引擎·godot
zdr尽职尽责5 小时前
Unity录像功能
学习·ui·unity·游戏引擎
真鬼1235 小时前
【Unity Cursor】AI规矩
unity·游戏引擎
mxwin6 小时前
Unity Shader 深入理解 LinearEyeDepth 与 DepthTexture
unity·游戏引擎
小贺儿开发6 小时前
Unity3D VR 全景图游览
unity·渲染·vr·虚拟现实·全景图·漫游·互动
开维游戏引擎15 小时前
AI自动生成游戏时,deepseek和mimo对比
android·游戏·语言模型·游戏引擎·ai编程