private SendEventToGameObject ( GameObject go, string eventName ) : void | ||
go | GameObject | |
eventName | string | |
return | void |
void SendEventToGameObject(GameObject go, string eventName)
{
// send to event delegate if exists, otherwise send it to the game object hit
EventDelegate eventDelegate = go.GetComponent<EventDelegate>();
if (eventDelegate)
eventDelegate.SendMessage(eventName, SendMessageOptions.DontRequireReceiver);
else
go.SendMessage(eventName, SendMessageOptions.DontRequireReceiver);
}