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

相关推荐
WiChP20 小时前
【V0.1B6】从零开始的2D游戏引擎开发之路
java·log4j·游戏引擎
小拉达不是臭老鼠20 小时前
Unity05_3D数学
学习·unity·游戏引擎
风酥糖1 天前
Godot游戏练习01-第28节-显示效果与音效
游戏·游戏引擎·godot
油炸自行车1 天前
Unity URDF 导入后运行报错问题笔记
笔记·unity·游戏引擎·数字孪生·urdf·工业仿真·虚拟与现实
南無忘码至尊1 天前
Unity学习90天 - 第 5 天 - 阶段小项目
学习·unity·c#·游戏引擎
郝学胜-神的一滴1 天前
中级OpenGL教程 001:从Main函数到相机操控的完整实现
c++·程序人生·unity·图形渲染·unreal engine·opengl
RReality1 天前
【Unity Shader URP】顶点波浪动画(Vertex Wave)实战教程
ui·unity·游戏引擎·图形渲染
魔士于安1 天前
Unity 简单水面效果URP
游戏·unity·游戏引擎·贴图·模型
mxwin1 天前
Unity Shader 毛发 & 草海渲染Alpha‑to‑Coverage 抗锯齿技术详解
unity·游戏引擎·shader
张老师带你学2 天前
unity TerrainSampleAssets
科技·游戏·unity·游戏引擎·模型