标签:
http://blog.csdn.net/you123you/article/details/8483926
游戏对象之间发送的广播与消息分为三种:第一种向子对象发送,将发送至该对象的同辈对象或者子孙对象中;第二种为给自己发送,发送至自己本身对象;第三种为向父对象发送,发送至该对象的同辈或者父辈对象中;
//向子类发送消息、
gameObject.BroadcastMessage("message","BroadcastMessage");
//给自己发送消息
gameObject.SendMessage("message","BroadcastMessage");
//向父类发送消息
gameObject.SendMessageUpwards("message","BroadcastMessage");
//接收父类发送的消息
function ReceiveBroadCastMessage(str:String){
}
//接收自己发送的消息
functio ReceiveSendMessage(str:String){
}
//接收子类发送的消息
function ReceiveSendMessageUpwards(str:String){
}
标签:
原文地址:http://www.cnblogs.com/notlate/p/4471024.html