Unity's picture shows the true size

Source: Internet
Author: User

Images into Unity's own properties

In the Hat game, see this piece of code

// get the bowling width itself float Ballwidth=ball. Getcomponent<renderer> (). bounds.extents.x;

When the bowling picture is dragged onto the item, the scale of the picture is 2,2,1, and the result is 1.28 when the above value is printed.

And the size of the picture itself is 128*128

So the actual width or height of the picture shown in unity is: wide (high)/100/2 Example: 128/100/2*2 (the last 2 indicates the size in scale)

The display in 100 is the default value, which indicates how many Pixels (pixels) A Unity unit displays the picture.

Unity's picture shows the true size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.