unity控制摄像机视图大小的算法

来源:互联网 发布:java缓存过程面试 编辑:程序博客网 时间:2024/05/21 19:39
using UnityEngine;using System.Collections;public class MinMap : MonoBehaviour {// Use this for initializationvoid Start () {        float ratio = (float)Screen.width / (float)Screen.height;        this.GetComponent<Camera>().rect = new Rect(( 0.8f), (1- 0.2f * ratio), 0.2f, 0.2f * ratio);}// Update is called once per framevoid Update () {}}

0 0
原创粉丝点击