Toggle execution order.

Hi there,
Does anybody know the order of Toggle methods execution.
I am having a script that runs in editors “onValueChange()”:

public void ffwd()
{
    if (myToggle.isOn==true)
    {
            Debug.Log("FFWD");
            audioPlay.pitch = 4;
    }
        else if(myToggle.isOn == false)
    {
            Debug.Log("FFWD back to normal");
            audioPlay.pitch = 1;
    }
}

This is a method in a script attached to the parent of the toggle.
What I am expecting is that by clicking 1st time the toggle (from off → on):
1st) IsOn to became true
2nd) Since (toggle.isOn == true ) → I expect to console to print “FFWD” and
3rd) pitch to go at 4.

And when I push toggle again,
1st) IsOn to became false
2nd) The Console to print “FFWD back to normal”
3rd) pitch to become 1

What I get is always the results for myToggle.isOn == false
(pitch to 1, and FFWD back to normal), even though the “isOn” in the inspector is being ticked. The only exception I got and get my method to work is momentary when I click the toggle very fast on and off.

What I am thinking is that maybe Unity first executes code and then turns toggle to true.
Could this be true, or I am missing something…?

Which Unity Version are you working with?

“onValueChange” is AFAIK Unity 5.2 and below. The wording has been revised to “onValueChanged”. I am not sure about the old behavior but now “onValueChanged” is called after isOn has changed.

However, you should be able to add a bool parameter in the method’s header which indicates which value is the new value.

I have Unity 5.5.1f1 (64), and indeed it is “on value Changed”, I had never noticed that.
What you propose is to make my manual change toggle, every time I press the button. My problem is that I change a toggles value from other methods too, and I got conflicts. Not things that can easily be corrected through script.
I just had to ask because it has no explanation, and I don’t need to write extra code.
Does it been affected from time.scale ==0 ?