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

相关推荐
一线灵5 小时前
跨平台游戏引擎 Axmol-2.11.6 发布
游戏引擎
两水先木示7 小时前
【Unity】Lens Flare光晕简单使用案例
unity·游戏引擎
专注仿真7 小时前
Unity 小游戏实战:2D 横版闯关 / 3D 跑酷 / 塔防 / 解谜四类项目工程化拆解与复用实践
游戏·游戏引擎·游戏程序
郝学胜-神的一滴19 小时前
游戏设计、原型与开发 26:四种循环
开发语言·数据结构·游戏·游戏引擎·游戏策划
两水先木示20 小时前
【Unity】刮刮乐案例-RenderTexture实现思路
unity·游戏引擎
学术小李1 天前
用虚幻引擎(UE)打开Obj模型
游戏引擎·虚幻
张不无-Unity1 天前
Unity的四种灯光Directional、Point、Spot 和 Area
unity·游戏引擎
淡海水2 天前
02-02-原理篇-Scriban模板引擎原理深度解析
unity·excel·游戏开发·luban
ttod_qzstudio3 天前
系统架构设计师论文逐句拆解(三):ATAM 架构评估,怎样把“方案比较”写成质量属性权衡
unity·架构·系统架构·软考
小贺儿开发4 天前
Unity 轻量级外部素材加载器(热更新)
科技·学习·unity·程序员·工具·热更新·ugui