Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 2
0
        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();
            }
        }