UIDocument blocks events for other layers? (New Input System + UI Toolkit)
Hi, I've been working on my project at Unity 2020.2.4f1 and updated version recently up to 2021.1.0b10 (still beta). There were some pointer down events which I've been processing via IPointerDownHandler on GameObjects with colliders (+ PhysicRaycaster on Camera object). I also use UI Toolkit for developing the UI. It worked just fine, the toolkit elements were responding normally to button clicks etc., so were my objects with IPointerDownHandler. But since I updated version to 2021.1.0b10, IPointerDownHandler can't register any events anymore. I tried to change layers and so on, but it didn't help.
The main thing is - IPointerDownHandler turns alive as soon as I deactivate UIDocument component on the scene.
What I'm also concerned about, IDragHandler / IBeginDragHandler began to work without any collider on the parent object after update. Maybe there are some behavioural changes which I missed? It feels like UIDocument just intercepts any events and drags are on the same "layer" or something
Here is the "clicker" script example:
namespace Scenes.Base.Controls.Raycast {
public class SmelteryClicker : MonoBehaviour, IPointerDownHandler {
private MainUI _mainUi;
void Start() {
_mainUi = GameObject.FindGameObjectWithTag("MainUI").GetComponent<MainUI>();
}
public void OnPointerDown(PointerEventData eventData) {
BaseGlobalState.SetCameraTransitionsLocked(true, BaseGlobalState.ViewPoint.SMELTERY);
_mainUi.smeltery.style.display = DisplayStyle.Flex;
}
}
}
The parent object contains "SphereCollider" component on it. GameObject with the Camera also has:
Event System
Player Input
Physics Raycaster
Input System UI Input Module
Also there is a "MainUIDocument" object with components:
Input System Event System (UI Toolkit)
UI Document
Raycaster event mask is 'everything'. So, the question is: why have pointer down events died after update? May it be a bug in beta version 2021.1.0b10 and it will be fixed soon? Or am I doing something wrong? Would really appreciate help
Unity UI package version is 1.0.0-preview.14
Your answer
