Why update inside code executed below return?

I don’t know why this code below return executed. Of course I checked nowWaitingTurn bool to true before start game.
But "TurnUpdate(1); " called.

public bool nowWaitingTurn = true;     
    public void Update()
    {
        if (!Application.isPlaying || nowWaitingTurn) return;

        switch (m_MapState)
        {
            case EMapState.Initialize:
                AdventureManager.Instance.TurnUpdate(1); 
......

Just taking a guess, but is nowWaitingTurn unchecked in the inspector though? The inspector would override what is set in the declaration (it doesn’t override Awake or Start though).

If not, are you sure that there isn’t something else setting nowWaitingTurn to false, and you’re sure that it isn’t the second frame or later where the rest is called? (presumably after something may have set nowWaitingTurn to false)

1 Like