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

相关推荐
WarPigs5 小时前
Unity红点系统笔记
unity·游戏引擎
郭逍遥7 小时前
[Godot] C#基于噪声的简单TileMap地图生成
游戏引擎·godot
作孽就得先起床12 小时前
unity UnauthorizedAccessException: 拒绝访问路径
unity·游戏引擎
tealcwu14 小时前
【Unity踩坑】Unity项目提示文件合并有冲突
elasticsearch·unity·游戏引擎
tealcwu1 天前
【Unity小技巧】如何将3D场景转换成2D场景
3d·unity·游戏引擎
全栈陈序员1 天前
用Rust和Bevy打造2D平台游戏原型
开发语言·rust·游戏引擎·游戏程序
鹿野素材屋1 天前
Unity模型中人形角色的嘴巴一直开着怎么办
unity
世洋Blog2 天前
Unity面经-List底层原理、如何基于数组、如何扩容、List存储泛型、List有关在内存中的结构
unity·面试·c#·list
神秘的土鸡2 天前
【CS创世SD NAND征文】为无人机打造可靠数据仓:工业级存储芯片CSNP32GCR01-AOW在飞控系统中的应用实践
嵌入式硬件·游戏引擎·无人机·cocos2d·雷龙
jtymyxmz2 天前
《Unity Shader》6.4.3 半兰伯特模型
unity·游戏引擎