How does the code looks like when I want to create a method which works only 20 seconds?
After those 20 seconds, my actor should act like before.
Thanks in advance!
// field
private int specialActionTimer;
// in act
specialAction();
// with method
private void specialAction()
{
if (specialActionTimer > 0)
{
// perform special action
specialActionTimer--;
}
}specialActionTimer = 1200; // 20 sec * 60 acts/sec