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

相关推荐
呆呆敲代码的小Y27 分钟前
【Unity 实用工具篇】| UX Tool 工具 快速上手使用,提高日常开发效率
游戏·unity·游戏引擎·游戏程序·ux
世洋Blog35 分钟前
Unity开发微信小程序-避开新InputSystem有关坑
unity·微信小程序
简简单单OnlineZuozuo14 小时前
提示架构:设计可靠、确定性的AI系统
人工智能·unity·架构·游戏引擎·基准测试·the stanford ai·儿童
uniGame2 天前
FrameDebugger使用说明
unity·性能优化
心之所向,自强不息2 天前
URP Shader编程规则之Properties
unity
飞浪纪元[FWC–FE]3 天前
【无标题】
unity·游戏引擎
红黑色的圣西罗3 天前
对象池简述
unity·c#
水龙吟啸3 天前
基于Orbbec-Gemini深度相机与SFM-2D to 3D重建算法、手部识别视觉算法、Unity运动控制的3D水果切割游戏
python·深度学习·神经网络·c#·游戏引擎·3d视觉·3d重建
淡海水3 天前
【节点】[Texture2DAsset节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·texture2dasset
向宇it3 天前
【unity游戏开发——网络】unity+PurrNet联机实战,实现一个多人对战类《CS/CSGO》《CF/穿越火线》《PUBG/吃鸡》的FPS射击游戏
游戏·unity·游戏引擎·交互·联机