void Awake() { if (autoAssignGlobal) { handle = PlayerHandleManager.GetNewPlayerHandle(); handle.global = true; foreach (ActionMapSlot actionMapSlot in actionMaps) { ActionMapInput actionMapInput = ActionMapInput.Create(actionMapSlot.actionMap); actionMapInput.TryInitializeWithDevices(handle.GetApplicableDevices()); actionMapInput.active = actionMapSlot.active; actionMapInput.blockSubsequent = actionMapSlot.blockSubsequent; handle.maps.Add(actionMapInput); } } }
public void Destroy() { foreach (var map in maps) { map.active = false; } for (int i = assignments.Count - 1; i >= 0; i--) { assignments[i].Unassign(); } currentInputConsumer.children.Remove(this); PlayerHandleManager.RemovePlayerHandle(this); if (onChange != null) { onChange.Invoke(); } }