Example #1
0
    /// <summary>
    /// Connect to Local and Networked message on this GameObject's box for this board type. Connecting
    /// will make this function called when it is sent a message directly or indirectly
    /// (via SendToLocal/Up/Down/ToAllConnected or by another client calling SendToNet/Up/Down/ToAllConnected)
    /// </summary>
    public static void Connect(FFMessageBox <EventType> .EventListener function, GameObject go)
    {
        GetReady();
        string id = BaseMessageBoard.LocalIdEntry(go.GetInstanceID());
        FFMessageBox <EventType> box;

        if (messageBoard.TryGetValue(id, out box))
        {
            box.Connect(function);
        }
        else
        {
            box = new FFMessageBox <EventType>(messageBoardSystem, id);
            box.Connect(function);
            messageBoard.Add(id, box);
        }
    }