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

相关推荐
妙为3 小时前
unreal engine5角色把敌人 “挤飞”
游戏引擎·虚幻·ue·unrealengine5
4Forsee3 小时前
【增强现实】快速上手 Vuforia Unity Android AR 应用开发
android·unity·ar
两水先木示4 小时前
【Unity】对指定物体进行描边——模板测试法
unity·游戏引擎·shader·外描边
Miss_SQ4 小时前
实现Unity录音、百度云语音转文字
unity·语音识别
CreasyChan5 小时前
unity 对象池实测可用
unity·c#
weixin_424294675 小时前
Unity项目的Artifacts文件夹过大怎么解决?
unity·游戏引擎
没事写写笔记13 小时前
Unity HDRP14.0.12 Volume 配置参数
unity
红黑色的圣西罗15 小时前
手游手动异形屏适配方案,类“明日方舟”
unity
syker1 天前
3D游戏引擎Bluely Engine 开发手册
开发语言·3d·游戏引擎
Longyugxq2 天前
Untiy的Webgl端网页端视频播放,又不想直接mp4格式等格式的。
unity·音视频·webgl