xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

讓Unity的主攝像機(jī),根據(jù)實際的設(shè)計尺寸,縮放到最佳視角。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?script.simplefade;
using?UnityEngine;
using?UnityEngine.SceneManagement;
using?UnityEngine.UI;

namespace?script
{
????public?class?Camerascript?:?MonoBehaviour
????{
????????//?設(shè)計區(qū)域像素尺寸(由各場景攝像機(jī)上的組件參數(shù)指定)
????????public?float?contentWidth;
????????public?float?contentHeight;

????????//屏幕主攝像機(jī)
????????private?Camera?_mainCamera;

????????//?屏幕當(dāng)前分辨率
????????private?int?_resolutionX;
????????private?int?_resolutionY;
????????private?FullScreenMode??_fullScreenMode?=?null;

????????//屏幕當(dāng)前寬高比
????????private?float?_aspectRatio;

????????//?屏幕當(dāng)前正交尺寸(正交模式)
????????private?float?_orthographicSize;

????????//?屏幕當(dāng)前透視角度(透視模式)
????????private?float?_fieldOfView;

????????//?Start?is?called?before?the?first?frame?update
????????private?void?Start()
????????{
????????????_mainCamera?=?GetComponent();
????????????//?InitFullscreenMode();
????????????ResizeCamera();
????????}

????????/**
?????????*?初始化全屏模式
?????????*/
????????private?void?InitFullscreenMode()
????????{
????????????string[]?commandLineArgs?=?Environment.GetCommandLineArgs();
????????????bool?found?=?false;
????????????List?values?=?new?List();
????????????foreach?(var?item?in?commandLineArgs)
????????????{
????????????????if?(item.IndexOf(“-“?StringComparison.Ordinal)?==?0)
????????????????{
????????????????????//?item是參數(shù)名
????????????????????if?(found)
????????????????????{
????????????????????????//?如果之前已經(jīng)找到參數(shù),則跳出循環(huán)
????????????????????????Output($“參數(shù)查找結(jié)束“);
????????????????????????break;
????????????????????}

????????????????????if?(item.IndexOf(“-screen-fullscreen“?StringComparison.Ordinal)?==?0)
????????????????????{
????????????????????????//?如果找到參數(shù),則開啟標(biāo)志
????????????????????????found?=?true;
????????????????????????Output($“找到全屏參數(shù):{item}“);
????????????????????}
????????????????}
????????????????else
????????????????{
????????????????????//?item是參數(shù)內(nèi)容
????????????????????if?(found)
????????????????????{
????????????????????????//?如果是找到參數(shù)狀態(tài),則保存該數(shù)值
????????????????????????values.Add(item);
????????????????????????Output($“添加參數(shù)值:{item}“);
????????????????????}
????????????????}
????????????}

????????????if?(values.Count?>?1)
????????????{
????????????????Output($“窗口模式參數(shù):({values[1].GetType()}){values[1]}“);
????????????????//?當(dāng)全屏參數(shù)大于1個時,取第二個作為全屏模式
????????????????switch?(values[1])
????????????????{
????????????????????case?“1“:
????????????????????????_fullScreenMode?=?FullScreenMode.FullScreenWindow;
????????????????????????break;
????????????????????case?“2“:
????????????????????????_fullScreenMode?=?FullScreenMode.MaximizedWindow;
????????????????????????break;
????????????????????case?“3“:
????????????????????????_fullScreenMode?=?FullScreenMode.ExclusiveFullScreen;
????????????????????????break;
????????????????????default:
????????????????????????_fullScreenMode?=?FullScreenMode.Windowed;
??

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????8451??2020-03-09?16:20??Camerascript.cs

評論

共有 條評論