Traditional Culture Encyclopedia - Photography major - How to set the camera size of 2d camera in unity

How to set the camera size of 2d camera in unity

Just install a new script on the camera and put the code in it.

Public? Class size: single behavior

{

//speed

Public floating? ChangeSpeed = 0.5f

Private floating maximum =? 13;

Private floating minimum =? 7;

Invalid update ()

{

What if? (enter. GetAxis ("mouse wheel")! = 0)

{

//Limit size

Camera.main.orthographicSize? =? Mathf。 clamp(camera . main . orthographicsize,minmum,maximum);

//Wheel replacement

Camera.main.orthographicSize? = ?

Camera.main.orthographicSize? -Input. Gaitacus

("mouse? scroll wheel ")* change speed;

}

}

}

Unity is a cross-platform 2D/3D game engine developed by Unity Technologies:

It takes interactive graphics development environment as the main way, and the compiler runs under Windows and Mac OSX, and can publish games to various platforms such as Windows, Wii, OSX, iOS or HTML5. In addition, Unity is a comprehensive creative tool, which is widely used in architectural visualization, real-time 3D animation and other types of interactive content.