How to synchronize in Unity?

Hi,
I have two monobehavior which modifies the value of 1 parameter.

  1. How do I know which monobehavior is called first?

  2. Also is there away to prioritize a monobehavior over the other (let behavior 1 do something
    before the other)?

  3. Is there away to explicitly block access to the parameter until I explicitly release the lock (the normal way to sync)?

Thanks.

  1. Order of equivalent priority scripts is not guaranteed.
  2. You can set the priority of scripts using Edit>Project Settings>Script Execution Order
  3. You could use your own boolean - these things are not threads so you can’t use synchronisation locks

Sometimes its worth having one item do something in Awake and the other in Start.