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 分钟前
Unity3D AI导航系统完全指南:从核心概念到动画耦合
人工智能·unity
__water15 分钟前
RHK《模型贴图自由更换位置》
unity·贴图·模型贴图·移动不丢失
JIes__28 分钟前
Unity(二)——3D数学
unity·游戏引擎
淡海水1 小时前
【节点】[RandomRange节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·randomrange
weixin_4242946716 小时前
在Unity中,摄像机移动时出现“残影”或“闪烁”是常见问题,主要原因和处理方法。
unity·游戏引擎
孟无岐16 小时前
【Laya】Browser 使用说明
typescript·游戏引擎·游戏程序·laya
天人合一peng17 小时前
unity 3d 通过游戏对象的名子查到其对象
游戏·unity·游戏引擎
纯属个人爱好18 小时前
Unity2020+PicoNeo3Pro开发
unity·vr
__water21 小时前
RHK《Unity接入DeepSeek问答》
unity·游戏引擎·智能问答·deepseek接入·deepseekapikey
康de哥1 天前
MCP Unity + Claude Code 配置关键步骤
unity·mcp·claude code