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

相关推荐
淡海水12 小时前
06-04-YooAsset源码-Unity加密解密服务
前端·unity·性能优化·c#·游戏引擎·yooasset
HH‘HH1 天前
Unity 项目创建标准指南:分辨率、尺寸、文件路径与命名规范
unity·游戏引擎
元气少女小圆丶1 天前
unity发布web嵌入到前端页面的接受参数
前端·unity·webgl
HH‘HH1 天前
Unity 打包程序设置及注意事项全攻略
unity·游戏引擎
fqbqrr1 天前
2607d,parin游戏引擎
游戏引擎·d
qq_170264751 天前
unity里 Burst的用法
unity·游戏引擎
HH‘HH2 天前
Unity 相机与光照调整:从基础到进阶的实战指南
unity
HH‘HH2 天前
Unity引擎界面各个功能面板详细介绍
unity·游戏引擎
℡枫叶℡2 天前
Unity 2D资产命名常用缩写
unity·资产命名缩写