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 () {
        
            }
    }

  • 相关阅读:
    10.15
    10.14
    11.12
    10.10
    10.9
    如何向jar包里写文件
    mycat的配置文件
    启动spring boot打成的zip包脚本
    通俗易懂的rpc原理
    当Mockito遭遇使用注解注入的变量
  • 原文地址:https://www.cnblogs.com/qqqeeebbb/p/3611532.html
Copyright © 2011-2022 走看看