mirror of
https://github.com/originalnicodr/CinematicUnityExplorer.git
synced 2025-07-19 01:57:56 +08:00
Avoid processing freecam input movement when there is a focused input field.
This commit is contained in:
@ -834,7 +834,7 @@ namespace UnityExplorer.UI.Panels
|
||||
}
|
||||
Transform movingTransform = FreeCamPanel.GetFreecam().transform;
|
||||
|
||||
if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && FreeCamPanel.connector?.IsActive != true) {
|
||||
if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && FreeCamPanel.connector?.IsActive != true && !IsInputFieldInFocus()) {
|
||||
ProcessInput(movingTransform);
|
||||
}
|
||||
|
||||
@ -868,6 +868,20 @@ namespace UnityExplorer.UI.Panels
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsInputFieldInFocus()
|
||||
{
|
||||
GameObject currentObject = EventSystemHelper.CurrentEventSystem.currentSelectedGameObject;
|
||||
if (currentObject != null)
|
||||
{
|
||||
UnityEngine.UI.InputField selectedInputField = currentObject.GetComponent<UnityEngine.UI.InputField>();
|
||||
if (selectedInputField != null)
|
||||
{
|
||||
return selectedInputField.isFocused;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void OnPreCull()
|
||||
{
|
||||
UpdateRelativeMatrix();
|
||||
|
Reference in New Issue
Block a user