Two adjacent drop-down boxes, click to expand the content, the selected content item will penetrate。
Hi 周小军,
This is a known issue. When a Dropdown
is opened, it instantiates a Canvas
and GraphicRaycaster
as components of the list. GraphicRaycaster
must instead be ZGraphicRaycaster
to work properly with zCore6.0.
Here is a script that fixes the problem by replacing GraphicRaycaster
each time the Dropdown is opened. It must be attached to each Dropdown
individually.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using zSpace.Core.UI;
public class DropdownRaycastEnforcer : MonoBehaviour, IPointerClickHandler
{
public void OnPointerClick(PointerEventData data)
{
GameObject obj =
this.gameObject.GetComponentInChildren<GraphicRaycaster>().gameObject;
Destroy(obj.GetComponent<GraphicRaycaster>());
obj.AddComponent<ZGraphicRaycaster>();
}
}
Regards,
Alex S.
Got it, thanks, and suddenly remembered the same thing in the HTC.INPUT.Utility.Plugin
According to you, it is only normal to delete the selected objects in the Hierarchy, especially the interference of the InputField object