from the category “bodged but works somewhat” i present thee this code:
[ExecuteAlways]
public class testscript :MonoBehaviour
{
public void Update()
{
Debug.Log("Update");
if (Input.GetMouseButton(0))
Debug.Log("testtest");
}
void OnDrawGizmos()
{
// Your gizmo drawing thing goes here if required...
#if UNITY_EDITOR
// Ensure continuous Update calls.
if (!Application.isPlaying)
{
UnityEditor.EditorApplication.QueuePlayerLoopUpdate();
UnityEditor.SceneView.RepaintAll();
}
#endif
}
}
i want to stress the somewhat specifically as this for example can miss clicks if you only check for MouseButtonDown instead of MouseButton.
But perhaps this is something that helps you find a better solution or someone else has something better at hand. Would be curious to see if there is a good solution to this.