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

相关推荐
熊猫悟道9 小时前
Unity shader 之,Shader内部时间离散处理
unity·游戏引擎·材质·着色器
PA_10 小时前
unity Component-Based Architecture游戏框架
游戏·unity·游戏引擎
yi碗汤园13 小时前
C#实现对UI元素的拖拽
开发语言·ui·unity·c#
jtymyxmz14 小时前
《Unity Shader》11.3.2 广告牌技术
unity·游戏引擎
jtymyxmz15 小时前
《Unity Shader》11.3.1 流动的河流
unity·游戏引擎
小马过河R16 小时前
开发游戏需要哪些岗位和角色参与
游戏·游戏引擎·游戏程序
jtymyxmz18 小时前
《Unity Shader》11.3.1 续 流动的水流的阴影
unity·游戏引擎
世洋Blog18 小时前
Unity性能优化-2d游戏的DrawCall
游戏·unity·面试·性能优化·游戏引擎
jtymyxmz18 小时前
《Unity Shader》11.2.2 滚动的背景
unity·游戏引擎
Tatalaluola19 小时前
Unity使用EPPlus读取写入表格
unity·c#·游戏引擎·excel