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

相关推荐
垂葛酒肝汤2 小时前
Unity第一个项目
unity·游戏引擎
Sator12 小时前
Unity的InputSystem常见问题和疑惑解答
java·unity·游戏引擎
郝学胜-神的一滴2 小时前
QtOpenGL多线程渲染方案深度解析
c++·qt·unity·游戏引擎·godot·图形渲染·unreal engine
IMPYLH4 小时前
Lua 的 Table 模块
开发语言·笔记·后端·junit·游戏引擎·lua
Howrun77720 小时前
虚幻引擎_控制角色移动的三种方法
游戏引擎·虚幻
速冻鱼Kiel1 天前
GASP笔记01
笔记·ue5·游戏引擎·虚幻
孟无岐1 天前
【Laya】Animator2D 使用指南
typescript·游戏引擎·游戏程序·laya
速冻鱼Kiel1 天前
GASP笔记02
笔记·ue5·游戏引擎·虚幻
__water1 天前
RHK《Unity接入PicoSDK入门》
unity·游戏引擎·picosdk
我的golang之路果然有问题1 天前
unity 资源导入 godot
unity·游戏引擎·godot