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

相关推荐
Madokaly15 小时前
DOTween的Vector3Plugin
unity
点心的游戏开发世界1 天前
GDScript 入门笔记(二):变量与数据类型
笔记·游戏引擎·godot
一梭键盘任平生1 天前
Shader入门笔记2
unity
点心的游戏开发世界1 天前
Unity C# 脚本学习笔记:命名空间与 using
学习·unity·c#
点心的游戏开发世界1 天前
Unity C# 脚本学习笔记:泛型
学习·unity·c#
郝学胜-神的一滴2 天前
CMake 047:解锁安装阶段自定义操作,告别配置阶段提前执行坑
运维·服务器·c++·游戏引擎·图形渲染·opengl
微三云生态系统架构师-彭丹3 天前
任务卷轴积分系统架构设计:从任务状态机到合规风控的完整实现
unity·系统架构·游戏引擎
XR技术研习社3 天前
从 PICO 文档看未来短期内的 Unity 版本选择
unity·游戏引擎·xr·vr
玖玥拾3 天前
Unity 热更新(一)
unity·游戏引擎
软件黑马王子3 天前
1.non-MonoBehaviour 单例模式泛型基类
unity·前端框架·c#