Exemplo n.º 1
0
        // Update is called once per frame
        void Update()
        {
            if (isRemapping)
            {
                if (remapPositive)
                {
                    positive = BindingUtils.GetAnyPressedKey();
                    if (positive != KeyCode.None)
                    {
                        BindingUtils.UpdatePositiveAxisText(bindingToMap, positive, buttonText);
                        remapPositive = false;
                    }
                }
                else
                {
                    negative = BindingUtils.GetAnyPressedKey();

                    if (negative != KeyCode.None)
                    {
                        BindingManager.RebindAxis(bindingToMap, positive, negative);
                        BindingUtils.UpdateTextWithBindingAxis(bindingToMap, buttonText);

                        isRemapping   = false;
                        remapPositive = true;
                        BindingManager.IsRemapping = false;
                        positive = KeyCode.None;
                        negative = KeyCode.None;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void Setup(string _toMap)
        {
            bindingToMap = _toMap;

            button.onClick.AddListener(OnClick);
            mappingName.text = _toMap;
            BindingUtils.UpdateTextWithBindingAxis(bindingToMap, buttonText);
            gameObject.SetActive(true);
        }