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

相关推荐
lambda10 小时前
游戏开发者的CMU动作数据使用指南:如何将AMC文件转Unity动画
unity·游戏开发·动作捕捉·cmu
淡海水11 小时前
【节点】[ComputeVertexPosition节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·position·compute·vertex
淡海水1 天前
【节点】[ScleraLimbalRing节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·ring·limbal·sclera
ellis19702 天前
Unity特殊目录小结
unity
淡海水2 天前
【节点】[IrisOutOfBoundColorClamp节点]原理解析与实际应用
unity·游戏引擎·iris·shadergraph·图形·clamp·bound
风痕天际3 天前
Godot扫雷游戏制作记录1——基础场景搭建
游戏·游戏引擎·godot·gdscript·教程
上证50指数etf3 天前
Unity面试总结
unity
爱搞虚幻的阿恺3 天前
Niagara粒子系统-超炫酷的闪电特效(第二期 旋转的纸片)
游戏·游戏引擎·虚幻
WarPigs3 天前
Unity渲染问题记录
unity·游戏引擎