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

相关推荐
淡海水6 小时前
【节点】[IrisLimbalRing节点]原理解析与实际应用
unity·游戏引擎·iris·shadergraph·图形·ring·limbal
在路上看风景8 小时前
33. RenderTarget
unity
在路上看风景9 小时前
34. GPU偏爱2的幂次
unity
Zik----9 小时前
Unity的基础使用
unity·游戏引擎
郁闷的网纹蟒1 天前
虚幻5---第16部分---敌人(中)
开发语言·c++·ue5·游戏引擎·虚幻
爱搞虚幻的阿恺1 天前
Niagara粒子系统-超炫酷的闪电特效(第一期 粒子的朝向与对齐)
游戏·ue5·游戏引擎·虚幻
在路上看风景1 天前
1.11 资源划分策略
unity
红黑色的圣西罗1 天前
Unity减少Draw和SetPassCall的手段简述
unity·游戏引擎
淡海水1 天前
【节点】[CorneaRefraction节点]原理解析与实际应用
unity·游戏引擎·shadergraph·图形·cornea·refraction
小贺儿开发1 天前
《唐朝诡事录之西行》——降魔变
科技·unity·人机交互·创意·文旅·hdrp