For Example.
int score = 0;
private bool missionSuccess=false;
private void Update()
{
Setvalue(5);
}
private void Setvalue(int value)
{
if(missionSuccess)
score += value;
}[/code]
if missionSuccess= true then the score will dramatically the value of the score every frame. What if I just want to add once when the bool missionSuccess turns true? can it be possibly solved by using delegates or event systems?
int score = 0;
private bool missionSuccess=false;
private void Update()
{
Setvalue(5);
}
private void Setvalue(int value)
{
if(missionSuccess)
score += value;
}[/code]
if missionSuccess= true then the score will dramatically the value of the score every frame. What if I just want to add once when the bool missionSuccess turns true? can it be possibly solved by using delegates or event systems?