Try   HackMD

[Unity Engine] 關於我在Unity中踩的一些坑 - UI篇

tags: TODO Unity Engine

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
持續更新中因為坑只會越踩越多

按鈕點下去沒反應

UI Button不能按可能來自以下這幾個原因
請先利用EventSystem查看點到甚麼物件

  1. Button沒有Raycast Target(預設為Image元件),或是Raycast Target沒有打勾(為false)
  2. Iteractable們有打勾(為false)
  3. 如果Button的Parent Canvas是巢狀的,則該Canvas需要加上GraphicsRaycaster元件
// nested canvas
RectTransform
|
|
+--- Canvas(1)
|
|
+--- Canvas(2)
        |
        |
        +--- Button
  1. 場景中沒有EventSystem

Ref: Can't click item

PointerEvent

Inherit from BaseEventData