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

相关推荐
AllBlue8 小时前
unity嵌入安卓界面,如何显示状态
android·unity·游戏引擎
tealcwu9 小时前
【Unity技巧】实现在Play时自动保存当前场景
java·unity·游戏引擎
tealcwu9 小时前
【Unity基础】实现Scroll View跟随动态内容滚动
java·unity·游戏引擎
野奔在山外的猫11 小时前
【文档】VSCode 配置 Unity 环境流程
unity
技术小甜甜11 小时前
[Godot排错] 上传 Google Play Console 封闭测试时签名证书不匹配错误的解决方案
游戏引擎·godot·游戏开发
变身缎带20 小时前
Unity中的NetworkManager基于protobuf, Socket-TCP
tcp/ip·unity·游戏引擎
AllBlue1 天前
unity调用安卓方法
android·unity·游戏引擎
郝学胜-神的一滴1 天前
Horse3D游戏引擎研发笔记(十):在QtOpenGL环境下,视图矩阵与投影矩阵(摄像机)带你正式进入三维世界
c++·3d·unity·游戏引擎·godot·图形渲染·unreal engine
AllBlue1 天前
unity导出成安卓工程,集成到安卓显示
android·unity·游戏引擎
Sator11 天前
Unity的FishNet相关知识
网络·unity·游戏引擎