Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
jugar si el jugador hace clic en un espacio en blanco unidad 2d

Estoy haciendo un juego 2d para dispositivos móviles y creé un botón de pausa en el lienzo. el problema es que cuando hago clic en el boton de pausa el jugador dispara. Ojalá hubiera una manera de bloquear el disparo cuando el toque está en un elemento de la interfaz de usuario. ¿Hay alguna forma sencilla de hacer esto?

este es el código que escribí para detectar clics:

 if(Input.touchCount > 0) { touch_ = Input.GetTouch(0); if(touch_.phase == TouchPhase.Began) { touching = true; touch_began_fun(); } if(tocando) { toching_fun(); } if(touch_.phase == TouchPhase.Ended) { touching = false; touch_ended_fun(); } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Verifique que el objeto de juego seleccionado actual del EventSystem sea nulo. Si no es nulo, el toque está en un elemento de la interfaz de usuario.

 if(Input.touchCount > 0) { touch_ = Input.GetTouch(0); if(touch_.phase == TouchPhase.Began && EventSystem.current.currentSelectedGameObject == null) { touching = true; touch_began_fun(); } if(tocando) { toching_fun(); } if(touch_.phase == TouchPhase.Ended) { touching = false; touch_ended_fun(); } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!