how to pass values between objects in C#

Hey guys!

What would the best way be to pass through values from one object to another with code?

Example: there are three objects (A, B and C), object A generates 10 bricks every 10 seconds, Object B collects the bricks at random times (however many that may be) and delivers them to Object C. Object C now needs to add the amount of bricks delivered to the amount of bricks that is already in storage. Each object must display their current value at any state of the game via a floating gui that sits on top of the objects.

I’m still kind of new to Unity so please forgive me if the answer is obvious, and a massive thanks for any help received.

Make you life easier by using the NotificationCentre

I have to somewhat disagree with rob as long as you only do lookups once so they dont effect proficiency during game play. i usually do them in the start function like this:

nameofotherscript bscript;
	void Start () {
bscript=GameObject.Find ("name of object").GetComponent<nameofotherscript>();

//now you can access the variables in the other script like this:

variables have to be public !!!