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

相关推荐
在路上看风景1 天前
20. 资源和脚本的绑定关系
unity
yj爆裂鼓手1 天前
unity对象池
unity·c#
在路上看风景1 天前
3.7 SRP Batcher
unity
快乐觉主吖1 天前
Unity方便修改产品名和包名的小工具
unity·游戏引擎
孟无岐1 天前
【Laya】HttpRequest 网络请求
网络·typescript·游戏引擎·游戏程序·laya
JIes__2 天前
Unity(二)——MonoBehavior中的重要内容
unity·游戏引擎
孟无岐2 天前
【Laya】LocalStorage 本地存储
typescript·游戏引擎·游戏程序·laya
妙为2 天前
unreal engine5角色把敌人 “挤飞”
游戏引擎·虚幻·ue·unrealengine5
4Forsee2 天前
【增强现实】快速上手 Vuforia Unity Android AR 应用开发
android·unity·ar
两水先木示2 天前
【Unity】对指定物体进行描边——模板测试法
unity·游戏引擎·shader·外描边