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

相关推荐
Zillionnn2 小时前
Unreal Engine 自动设置图像
游戏引擎·虚幻
4 小时前
Unity开发中常用的洗牌算法
java·算法·unity·游戏引擎·游戏开发
马特说8 小时前
Unity VR手术模拟系统架构分析与数据流设计
unity·系统架构·vr
心前阳光1 天前
Unity WebGL文本输入
unity·游戏引擎·webgl
天涯过客TYGK1 天前
unity A星寻路
unity·游戏引擎
KhalilRuan1 天前
Unity Demo——3D平台跳跃游戏笔记
笔记·游戏·unity·游戏引擎
AA陈超2 天前
虚幻引擎UE5专用服务器游戏开发-20 添加基础能力类与连招能力
c++·游戏·ue5·游戏引擎·虚幻
ttod_qzstudio2 天前
Unity中使用EzySlice实现模型切割与UV控制完全指南
unity
南無忘码至尊2 天前
Unity 实现与 Ollama API 交互的实时流式响应处理
unity·游戏引擎·交互
平行云2 天前
如何实现UE程序大并发多集群的像素流部署
unity·ue5·图形渲染