Пример #1
0
    /// <summary>
    /// Request that 'method' is no longer invoked by OscIn.
    /// </summary>
    public void UnmapImpulseNullOrEmpty(UnityAction method)
    {
        // UnityEvent is secret about whether we removed a runtime handler, so we have to iterate the whole array og mappings.
        for (int m = _mappings.Count - 1; m >= 0; m--)
        {
            OscMapping mapping = _mappings[m];

            // If there are no methods mapped to the hanlder left, then remove mapping.
            mapping.Unmap(method.Target, method.Method);
            //if( mapping.ImpulseNullEmptyHandler.GetPersistentEventCount() == 0 ) _mappings.RemoveAt( m );
        }
        _dirtyMappings = true;
    }
Пример #2
0
    void Unmap <T>(Action <T> method, OscMessageType type)
    {
        for (int m = _mappings.Count - 1; m >= 0; m--)
        {
            OscMapping mapping = _mappings[m];

            mapping.Unmap(method.Target, method.Method);

            // If there are no methods mapped to the hanlder left, then remove mapping.
            if (mapping.entryCount == 0)
            {
                _mappings.RemoveAt(m);
            }
        }
        _dirtyMappings = true;
    }