unity控制摄像机视图大小的算法
2016-05-26 20:34
549 查看
using UnityEngine; using System.Collections; public class MinMap : MonoBehaviour { // Use this for initialization void 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 frame void Update () { } }
相关文章推荐
- unity路径跟随的算法
- unity总结1
- Unity3D中各种Path
- Unity3d Input按键系统
- unity3d之在屏幕上画线
- 在Unity里内嵌SVN基本操作
- 在Unity5中使用C#脚本实现UI的下滑、变色、渐隐渐现效果
- unity文件夹
- unity3d常用的游戏对象引用技巧
- Unity3D中的线性插值Lerp()函数解析
- UNITY3D自学(五)-- 导航寻路的学习
- unity中如何解决两个物体的绑定
- Unity 2D射线与 3D射线 UI射线
- Unity5.x的GUIText被UI Text所取代--增加头文件UnityEngine.UI
- Unity3D客户端和Java服务端使用Protobuf
- unity ugui自适应
- unity 优化 WaitForTargetFPS Gfx.WaitForPresent Graphics.PresentAndSync
- Unity3D 物体移动方式总结
- unity3d 各种路径&权限
- Unity实用案例之——CameraController