OnPointerEnter被画布组阻止。

huangapple go评论109阅读模式
英文:

OnPointerEnter being blocked by canvas group

问题

I set up an inventory system, now I am working on setting up the ability to open and close it. I figured I could use a canvas group to set the alpha to 0 and then disable the relevant lines of code in the inventory scripts. I'm not at that point yet because the canvas group has stopped OnPointerEnter from working. Here is the code for the pointer enter.

It does not work when the hierarchy is like this.

But it does work when the hierarchy is set up this way, so I'm pretty sure the issue is the canvas group is blocking the inventoryGrid OnPointerEnter from working.

So, why does the canvas group block the pointerEnter, and is there a way around it? Or will I have to just have a better way of hiding the inventory screen?

英文:

I set up an inventory system, now i am working on setting up the ability to open and close it. I figured i could use a canvas group to set the alpha to 0 and then disable the relevant lines of code in the inventory scripts. Im not at that point yet, because the canvas group has stopped OnPointerEnter from working. OnPointerEnter被画布组阻止。 Here is the code for the pointer enter.

OnPointerEnter被画布组阻止。
it does not work when the heirarchy is like this.

OnPointerEnter被画布组阻止。
but it does work when the heirarchy is set up this way, so im pretty sure the issue is the canvas group is blocking the inventoryGrid OnPointerEnter from working.

So, why does the canvas group block the pointerEnter, and is there a way around it? Or will i have to just have a better way of hiding the inventory screen?

答案1

得分: 0

检查你的CanvasGroup的Interactable和BlockRaycasts属性。你可以在这里找到更多信息。

英文:

Check the Interactable and BlockRaycasts properties of your CanvasGroup. You can find more info here.

huangapple
  • 本文由 发表于 2023年4月4日 05:09:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/75923789.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定