Actions menu imp. Still buggy at first render
This commit is contained in:
@@ -12,13 +12,14 @@ public class ItemActionsUI : MonoBehaviour
|
||||
[SerializeField]
|
||||
private Button _btnCancel;
|
||||
|
||||
private void Awake()
|
||||
private void Start()
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void Show(string title, string description)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
_title.text = title;
|
||||
_description.text = description;
|
||||
|
||||
@@ -26,12 +27,10 @@ public class ItemActionsUI : MonoBehaviour
|
||||
{
|
||||
Hide();
|
||||
});
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
private void Hide()
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
//Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MouseInputManager : MonoBehaviour
|
||||
if (baseObject != null)
|
||||
{
|
||||
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = baseObject });
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
_waypointVisual.SetWaypoint(baseObject._playerArrivePoint.position);
|
||||
Player.Instance.AddTask(new PlayerTasks(Tasks.Interact, baseObject));
|
||||
@@ -50,7 +50,7 @@ public class MouseInputManager : MonoBehaviour
|
||||
else
|
||||
{
|
||||
OnSelectedObjectChanged?.Invoke(this, new OnSelectedObjectChangedEventArgs() { SelectedObject = null });
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
if (Input.GetMouseButtonDown(0) && !EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
if (Physics.Raycast(_camera.ScreenPointToRay(Input.mousePosition), out RaycastHit hit, 100f, _walkableLayerMask))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user