示例#1
0
 public void Unregister(KoreographyEventCallbackWithTime callback)
 {
     timedEvent -= callback;
 }
示例#2
0
    public void UnregisterForEvents(string eventID, KoreographyEventCallbackWithTime callback)
    {
        if (string.IsNullOrEmpty(eventID))
        {
            Debug.LogError("Cannot unregister for events with an empty event identifier!");
        }
        else
        {
            KeyValuePair<string,EventObj> mapping = eventBoard.Find(x=>x.Key == eventID);

            // KeyValuePair generics treat the key as a property, which can return null.
            if (!string.IsNullOrEmpty(mapping.Key))
            {
                // Remove the Obj->Koreographer link.
                mapping.Value.Unregister(callback);

                if (mapping.Value.IsClear())
                {
                    // If there isn't a reason for this to exist anymore, clean it up!

                    // Remove the Koreographer->Koreography link.
                    DisconnectEventFromLoadedKoreography(mapping);

                    eventBoard.Remove(mapping);
                }
            }
        }
    }
示例#3
0
    public void UnregisterForEventsWithTime(string eventDef, KoreographyEventCallbackWithTime callback)
    {
        KoreographyTrack koreoTrack = mTracks.Find(x=>x.EventID == eventDef);

        if (koreoTrack != null)
        {
            koreoTrack.UnregisterForEventsWithTime(callback);
        }
        else
        {
            Debug.LogWarning("WARNING: no Koreography Track with event definition '" + eventDef + "' to unregister from.");
        }
    }
示例#4
0
    public void RegisterForEventsWithTime(string eventID, KoreographyEventCallbackWithTime callback)
    {
        if (string.IsNullOrEmpty(eventID))
        {
            Debug.LogError("Cannot register for events with an empty event identifier!");
        }
        else
        {
            KeyValuePair<string,EventObj> mapping = eventBoard.Find(x=>x.Key == eventID);

            // KeyValuePair generics treat the key as a property, which can return null.
            if (string.IsNullOrEmpty(mapping.Key))
            {
                mapping = new KeyValuePair<string, EventObj>(eventID, new EventObj());
                eventBoard.Add(mapping);

                // New Mapping (we haven't encountered this event ID before).  Register with previously
                //  loaded Koreography!
                // Adds the Koreographer->Koreography link.
                ConnectEventToLoadedKoreography(mapping);
            }

            // Add the Obj->Koreographer link.
            mapping.Value.Register(callback);
        }
    }
示例#5
0
 public void UnregisterForEventsWithTime(KoreographyEventCallbackWithTime callback)
 {
     koreographyEventCallbacksWithTime -= callback;
 }