unity 设置帧数

来源:互联网 发布:淘宝客佣金分成 编辑:程序博客网 时间:2024/04/26 18:38

1、在Quality(质量)设置里把帧数设定关闭image之后才能在代码中修改游戏运行的帧数

 

2、在Unity中新建脚本UpdateFrame.cs ,编写如下代码

复制代码
using UnityEngine;using System.Collections;/// <summary>/// 功能:修改游戏FPS/// </summary>public class UpdateFrame : MonoBehaviour{    //游戏的FPS,可在属性窗口中修改    public int targetFrameRate = 300;        //当程序唤醒时    void Awake ()    {        //修改当前的FPS        Application.targetFrameRate = targetFrameRate;    }    }

0 0
原创粉丝点击