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

相关推荐
qq_5982117572 小时前
Unity.UGUI DrawCall合批笔记
笔记·unity·游戏引擎
南玖yy10 小时前
C/C++ 内存管理深度解析:从内存分布到实践应用(malloc和new,free和delete的对比与使用,定位 new )
c语言·开发语言·c++·笔记·后端·游戏引擎·课程设计
Tech Synapse11 小时前
Unity ML-Agents实战指南:构建多技能游戏AI训练系统
人工智能·游戏·unity
虾球xz12 小时前
游戏引擎学习第272天:显式移动转换
c++·学习·游戏引擎
咩咩觉主1 天前
c#数据结构 线性表篇 非常用线性集合总结
开发语言·数据结构·unity·c#·游戏引擎·程序框架
虾球xz1 天前
游戏引擎学习第271天:生成可行走的点
c++·学习·游戏引擎
虾球xz1 天前
游戏引擎学习第274天:基于弹簧的动态动画
c++·学习·游戏引擎
虾球xz1 天前
游戏引擎学习第273天:动画预览
c++·学习·游戏引擎
浅陌sss2 天前
Unity中AssetBundle使用整理(一)
unity·游戏引擎
虾球xz2 天前
游戏引擎学习第269天:清理菜单绘制
c++·学习·游戏引擎