Answers for "unity do something when button is pressed second time"

C#
0

unity do something when button is pressed second time

private int lastPressed = 0;

 if (something something)
         {
             lastPressed++;
 
             if (lastPressed > 1)
             {
                 // run code

                 // reset button lastPressed to 0
                 lastPressed = 0;
             }
         }
Posted by: Guest on November-24-2020

Code answers related to "unity do something when button is pressed second time"

C# Answers by Framework

Browse Popular Code Answers by Language