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

相关推荐
极客柒4 小时前
Unity 大地图高性能砍树顶点动画Shader
unity·游戏引擎
avi91117 小时前
UnityProfiler游戏优化-举一个简单的Editor调试
游戏·unity·游戏引擎·aigc·vibe coding·editor扩展
学嵌入式的小杨同学7 小时前
C 语言实战:动态规划求解最长公共子串(连续),附完整实现与优化
数据结构·c++·算法·unity·游戏引擎·代理模式
学嵌入式的小杨同学10 小时前
顺序表(SqList)完整解析与实现(数据结构专栏版)
c++·算法·unity·游戏引擎·代理模式
程序猿多布11 小时前
HybridCLR热更打包后AOT泛型函数实例化缺失处理
unity·hybridclr·aot generic
平行云12 小时前
实时云渲染支持数字孪生智能工厂:迈向“零原型”制造
人工智能·unity·ue5·云计算·webrtc·制造·实时云渲染
dzj202112 小时前
Unity中使用LLMUnity遇到的问题(一)
unity·llm·llmunity
Howrun77712 小时前
虚幻引擎 C++ 制作“射击FPS游戏“
游戏·游戏引擎·虚幻
DowneyJoy12 小时前
【Unity通用工具类】列表扩展方法ListExtensions
unity·c#·交互
极客柒12 小时前
Unity 大地图 高性能路径引导Shader
unity·游戏引擎