button click determination

Asked 2 years ago, Updated 2 years ago, 45 views

If there is an object (imageUI) above the button (background), is there a way to ensure that the overlapping objects have the same effect?

There is a button all over the bagground.Press button to start the process.
You can't press where it overlaps with an object, so you can handle it even if it overlaps.
Is there a way?

c# unity3d

2022-09-29 22:43

1 Answers

Assume that you want to do what you want to do is "I want to detect clicks across the screen."

You just need to detect clicks without using UIButton.

void Update(){
    if(Input.GetMouseButtonDown(0)){
        Debug.Log("Pressed left click.");
    }
}

http://docs.unity3d.com/jp/current/ScriptReference/Input.GetMouseButtonDown.html

  • What is button?
  • What is imageUI?


2022-09-29 22:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.