Exemple #1
0
        public void RemoveActionSet(InputActionSet set)
        {
            if (set == null)
            {
                throw new ArgumentNullException("set");
            }

            ArrayHelpers.Erase(ref m_ActionSets, set);
        }
Exemple #2
0
        private void OnDisconnected(int id)
        {
            if (m_ConnectedIds == null || !ArrayHelpers.Contains(m_ConnectedIds, id))
                return;

            ArrayHelpers.Erase(ref m_ConnectedIds, id);

            SendToSubscribers(InputRemoting.MessageType.Disconnect, new MessageEventArgs {playerId = id});
        }
Exemple #3
0
        public void RemoveActionMap(InputActionMap map)
        {
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            ArrayHelpers.Erase(ref m_ActionMaps, map);
        }
        protected override void OnRemoved()
        {
            base.OnRemoved();

            ArrayHelpers.Erase(ref s_Devices, this);
            if (current == this)
            {
                current = null;
            }
        }
Exemple #5
0
        protected override void OnRemoved()
        {
            // Remove from array.
            var wasFound = ArrayHelpers.Erase(ref s_Gamepads, this);

            Debug.Assert(wasFound, string.Format("Gamepad {0} seems to not have been added but is being removed", this));
            if (wasFound)
            {
                --s_GamepadCount;
            }
        }
Exemple #6
0
        public void RemoveActionMap(InputActionMap map)
        {
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            // Ignore if not part of this asset.
            if (map.m_Asset != this)
            {
                return;
            }

            ArrayHelpers.Erase(ref m_ActionMaps, map);
            map.m_Asset = null;
        }
Exemple #7
0
        protected override void OnRemoved()
        {
            if (current == this)
            {
                current = null;
            }

            // Remove from `all`.
            var wasFound = ArrayHelpers.Erase(ref s_Gamepads, this);

            Debug.Assert(wasFound, $"Gamepad {this} seems to not have been added but is being removed");
            if (wasFound)
            {
                --s_GamepadCount;
            }
        }
        /// <summary>
        /// Remove the given action map from the asset.
        /// </summary>
        /// <param name="asset">Asset to add the action map to.</param>
        /// <param name="map">An action map. If the given map is not part of the asset, the method
        /// does nothing.</param>
        /// <exception cref="ArgumentNullException"><paramref name="asset"/> or <paramref name="map"/> is <c>null</c>.</exception>
        /// <exception cref="InvalidOperationException"><paramref name="map"/> is currently enabled (see <see
        /// cref="InputActionMap.enabled"/>).</exception>
        /// <seealso cref="RemoveActionMap(InputActionAsset,string)"/>
        /// <seealso cref="InputActionAsset.actionMaps"/>
        public static void RemoveActionMap(this InputActionAsset asset, InputActionMap map)
        {
            if (asset == null)
            {
                throw new ArgumentNullException(nameof(asset));
            }
            if (map == null)
            {
                throw new ArgumentNullException(nameof(map));
            }
            if (map.enabled)
            {
                throw new InvalidOperationException("Cannot remove an action map from the asset while it is enabled");
            }

            // Ignore if not part of this asset.
            if (map.m_Asset != asset)
            {
                return;
            }

            ArrayHelpers.Erase(ref asset.m_ActionMaps, map);
            map.m_Asset = null;
        }
 public void Dispose()
 {
     ArrayHelpers.Erase(ref owner.m_Subscribers, this);
 }
        protected override void OnRemoved()
        {
            base.OnRemoved();

            ArrayHelpers.Erase(ref s_Devices, this);
        }