http://blog.csdn.net/you123you/article/details/8483926
The broadcasts and messages sent between the game objects are divided into three types: the first one is sent to the child object, it is sent to the object's sibling or descendant object, the second is sent to itself, sent to itself, and the third is sent to the parent object, and sent to the object's peers or parents object;
Send a message to the child class,
Gameobject.broadcastmessage ("message", "Broadcastmessage");
Send a message to yourself
Gameobject.sendmessage ("message", "Broadcastmessage");
Send a message to the parent class
Gameobject.sendmessageupwards ("message", "Broadcastmessage");
Receives the message sent by the parent class
function Receivebroadcastmessage (str:string) {
}
Receive messages that you send
Functio Receivesendmessage (str:string) {
}
Receive messages sent by subclasses
function Receivesendmessageupwards (str:string) {
}
Unity3d sending broadcasts and messages