Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

117
Visualizações
Does On Value Change based on framerate?

If I use an event OnValueChanged for an UI element, for example a slider. Is it better (for performance) to listen the slider values change in an Update() or does the event is already based on the same framerate than Update()?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

From the performance point of view, it is better for you to use the event rather than checking the value of the slider everything. Because in Update() your script is requesting the value of the slider and also checking the value of the slider because you want to check whether the value of the slider is changed or not, and an event will only be triggered when the value of the slider is changed.

And by a change in value I mean if you change the value of the slider either from a script or from the user sliding the sliding_head of the slider.

And this is true for all other Unity's UI elements that have OnValueChange() event for us to subscribe to.

I hope that this helps you sort out your confusion.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda