Exemple #1
0
 public void Start()
 {
     _inputModule = GetComponent <InControlInputModule>();
     checkActiveDeviceController(InputManager.ActiveDevice);
     InputManager.OnActiveDeviceChanged += checkActiveDeviceController;
     InputManager.OnDeviceDetached      += checkActiveDeviceController;
 }
Exemple #2
0
        void OnEnable()
        {
            actions        = PlayerActions.CreateBindings();
            actions.Device = null;

            inControlInputModule = FindObjectOfType <InControlInputModule>();
            inControlInputModule.SubmitAction = actions.Submit;
            inControlInputModule.CancelAction = actions.Cancel;
            inControlInputModule.MoveAction   = actions.Direction;
        }
    private void OnEnable()
    {
        CreateActions();
        InControlInputModule component = GetComponent <InControlInputModule>();

        if (component != null)
        {
            component.SubmitAction = actions.Submit;
            component.CancelAction = actions.Cancel;
            component.MoveAction   = actions.Move;
        }
    }
Exemple #4
0
 private void OnEnable()
 {
     state       = MenuSystemState.Inactive;
     instance    = this;
     inputModule = UnityEngine.Object.FindObjectOfType <InControlInputModule>();
     eventSystem = UnityEngine.Object.FindObjectOfType <EventSystem>();
     MenuTransition[] componentsInChildren = GetComponentsInChildren <MenuTransition>();
     MenuTransition[] array = componentsInChildren;
     foreach (MenuTransition menuTransition in array)
     {
         menuTransition.gameObject.SetActive(value: false);
     }
 }
Exemple #5
0
 public void OnClick()
 {
     MenuSystem.keyboardState = KeyboardState.BindKeyboardKey;
     inputModule = UnityEngine.Object.FindObjectOfType <InControlInputModule>();
     inputModule.gameObject.SetActive(value: false);
     listenRect.CrossFadeAlpha(1f, 0.2f, ignoreTimeScale: true);
     coverRect.GetComponent <CanvasRenderer>().SetColor(Color.white);
     GetComponent <Image>().CrossFadeColor(new Color(1f, 0.8f, 0f, 1f), 0f, ignoreTimeScale: true, useAlpha: true);
     keysText.text = "????";
     action.Owner.ListenOptions.OnBindingFound    = OnBindingFound;
     action.Owner.ListenOptions.OnBindingAdded    = OnBindingAdded;
     action.Owner.ListenOptions.OnBindingRejected = OnBindingRejected;
     action.ListenForBinding();
 }
Exemple #6
0
 private void OnEnable()
 {
     instance    = this;
     inputModule = UnityEngine.Object.FindObjectOfType <InControlInputModule>();
     Show(showMessages: false, showType: false);
     serverCommands.helpColor = (clientCommands.helpColor = "<#FFFF7F>");
     serverCommands.RegisterCommand("?", serverCommands.OnHelp);
     serverCommands.RegisterCommand("help", serverCommands.OnHelp);
     clientCommands.RegisterCommand("?", clientCommands.OnHelp);
     clientCommands.RegisterCommand("help", clientCommands.OnHelp);
     RegisterCommand(server: true, client: true, "list", OnList, "#MULTIPLAYER/CHAT.HelpList");
     RegisterCommand(server: true, client: true, "mute", OnMute, "#MULTIPLAYER/CHAT.HelpMute");
     RegisterCommand(server: true, client: false, "kick", OnKick, "#MULTIPLAYER/CHAT.HelpKick");
 }
Exemple #7
0
            private static void Prefix(InControlInputModule __instance, ref TwoAxisInputControl ___direction)
            {
                try
                {
                    if (!(Instance.Target is NavigateWithKeyboard navigate))
                    {
                        return;
                    }

                    // avoid overwriting controller movement/presses
                    __instance.MoveAction   = ___direction.Vector == Vector2.zero ? navigate.Move : null;
                    __instance.SubmitAction = !__instance.SubmitButton().IsPressed ? navigate.Submit : null;
                    __instance.CancelAction = !__instance.CancelButton().IsPressed ? navigate.Cancel : null;
                }
                catch (Exception exception) { Main.Logger.Exception(exception); }
            }
 public static InputControl CancelButton(this InControlInputModule @this) => @this.Device.GetControl((InputControlType)@this.cancelButton);
 public static InputControl SubmitButton(this InControlInputModule @this) => @this.Device.GetControl((InputControlType)@this.submitButton);
Exemple #10
0
    //public static EventSystemManager instance;

    void Awake()
    {
        ICIM = GetComponent <InControlInputModule>();
    }