【Unity】Bug Collection

1.NAN:not a number。

   Solution: If there is a case of dividing by 0 or a negative number under the root sign, it will appear. That is, it cannot be established mathematically.

2. Mathf.Lerp(0,1,Time.deltatime); is always a fixed value, and there is no expected gradient effect.

   Solution: The third parameter of this function is to take a number between a and b in proportion (and the range is 0 to 1), and Time.deltatime is the time from the previous frame to this frame, which is a fixed value.

   To produce a gradient effect, you can set a or b as a variable.

   比如:transform.position=Mathf.Lerp(transform.position,10,Time.deltatime);

3. When the sprite wrap of the Button is set, the highlighted image is inconsistent with the default image size.

  Solution: Do not use automatic slices for cropping. Although it is the same picture and the same position, the cropping is different! Then it went wrong.

4. When the gameObject is in the setActive(false) stage, it cannot be found in the code.

5. UGUI removes its raycast attribute for purely decorative images, so that the click of normal interactive objects will not be affected.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325722566&siteId=291194637