I want to toggle between function with the left mouse click. So basically, I want my the screen to start with displaying func1(func1 is activated), then when you press the left mouse button func1 gets deactivated and func2 gets activated, and then when you press left mouse button again func2 gets deactivated and func3 gets activated and when you press the left mouse button again func3 gets deactivated and func1 get activated and this keeps looping.
bool tappedOnce = true;
bool tappedTwice = false;
bool tappedThrice = false;
void func1() {print("func1");}
void func2() {print ("func2");}
void func3() {print ("func3");}
void toggle()
{
if (Input.GetKeyDown(KeyCode.Mouse0)&& tappedOnce == false){tappedOnce = true; func1();}
if (Input.GetKeyDown(KeyCode.Mouse0)&& tappedOnce && tappedTwice == false ){func2(); tappedTwice = true;}
if (Input.GetKeyDown(KeyCode.Mouse0)&& tappedOnce && tappedTwice && tappedThrice == false){func3(); tappedOnce = false; tappedTwice = false;}
}
Asking it here because this question was marked off topic on - game development stack exchange - and they suggested me to ask the question here.