public bool Button(string title) { RenderUtils.DrawRect(CurrentControlRect, Color.blue, title); if (CurrentControlRect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { if (Input.GetMouseButtonDown(0)) { return true; } } CurrentControlRect.y = CurrentControlRect.y + (DefaultControlHeight + InterControlDistance); return false; } CSHARP public bool Button(string title) { RenderUtils.DrawRect(CurrentControlRect, Color.blue, title); if (CurrentControlRect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { if (Input.GetMouseButtonDown(0)) { return true; } } CurrentControlRect.y = CurrentControlRect.y + (DefaultControlHeight + InterControlDistance); return false; } по такому же принципу у меня работают Toggle и InputInt, и они тоже даблкликают
если что, не использую юнити имгуи потомучто в самой игре разрабы какой-то хуйни натворили и менюшка от юнити не реагирует на нажатия
попробуй public bool Button(string title) { RenderUtils.DrawRect(CurrentControlRect, Color.blue, title); if (CurrentControlRect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { if (Event.current.type == EventType.MouseDown && Event.current.button == 0) { return true; } } CurrentControlRect.y += DefaultControlHeight + InterControlDistance; return false; } Code public bool Button(string title) { RenderUtils.DrawRect(CurrentControlRect, Color.blue, title); if (CurrentControlRect.Contains(new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y))) { if (Event.current.type == EventType.MouseDown && Event.current.button == 0) { return true; } } CurrentControlRect.y += DefaultControlHeight + InterControlDistance; return false; }
ялюблюпиво, пробовал. оно вообще не реагирует на нажатия. но я уже перешел на имгуи хук от киеро, и щас ебашу c# + c++