Unity中一些小的值得注意的地方

1. Mathf.RoundToInt 函数

If the number ends in .5 so it is halfway between two integers, one of which is even(偶数) and the other odd(奇数), the even number is returned.

注意的是,当数字最后为.5时,它夹在两个整数之间,这两个整数一个是奇数一个是偶数,函数将返回那个偶数。

posted @ 2014-02-19 22:59  michael111  阅读(158)  评论(0编辑  收藏  举报