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

相关推荐
游乐码18 小时前
Unity(十六)切换场景及鼠标相关
unity·游戏引擎
FakeEnd19 小时前
Unity开发笔记6
笔记·unity·游戏引擎
游乐码19 小时前
Unity(十七)Unity随机数及Unity委托
unity·游戏引擎
ellis197019 小时前
Unity性能优化之检测工具Profiler
unity·性能优化
RPGMZ21 小时前
RPGMZ游戏引擎 一个窗口 文本居中显示
开发语言·javascript·游戏引擎·rpgmz
tohand1 天前
Unity 完美假阴影实现文档
unity·游戏引擎
@蓝莓果粒茶1 天前
【Unity笔记】保姆级AssetBundle详解(含代码+避坑指南)
笔记·游戏·unity
Zephyr_01 天前
Unity2D游戏制作
游戏·unity
nnsix1 天前
Unity 动画 Avatar 笔记
笔记·unity·游戏引擎
拾忆丶夜1 天前
unity 热力图学习
学习·unity·游戏引擎