zoukankan      html  css  js  c++  java
  • Unity3D 改为按宽度缩放的方法

    using UnityEngine;
    using System.Collections;

    public class CameraController : MonoBehaviour {
        
        public float backgoundWidthInpixel;
          

        // Use this for initialization
        void Start () {     
        
            float backgoundWidth = backgoundWidthInpixel/100;  //100 is the pixels to unit value
        
            float retio =(float) (Screen.width)/(float) (Screen.height);

            float newSize =  backgoundWidth/retio;
            
            camera.orthographicSize = newSize/2;
        }
        
        // Update is called once per frame
        void Update () {
        
            }
    }

  • 相关阅读:
    socket
    netstat
    列表
    突然发现不会写代码了
    算法资源
    bit位操作
    排序算法
    连续子数组最大和
    books
    凸优化
  • 原文地址:https://www.cnblogs.com/qqqeeebbb/p/3611532.html
Copyright © 2011-2022 走看看