Пример #1
0
        public void RegisterAction(InputBindingsManager bindingsManager)
        {
            _bindings = bindingsManager;

            if (axes.Length == 0)
            {
                Debug.LogError("need some axes to choose between");
                return;
            }

            string[] options = new string[axes.Length];
            for (int i = 0; i < axes.Length; i++)
            {
                options[i] = axes[i].ToString();
            }

            var binding = _bindings.GerCurrentBinding(action) ?? new InputBindingsManager.ControlBinding
            {
                axis = axes[0]
            };

            var initialOption = Mathf.Max(Array.IndexOf(axes, binding.axis), 0);

            choices.SetOptions(options, initialOption);
        }
Пример #2
0
 public void RegisterAction(InputBindingsManager bindingsManager)
 {
     _bindings = bindingsManager;
     _bindings.RegisterAction(
         action,
         str => onRebindActionString.Invoke(str),
         spr => onRebindActionSprite.Invoke(spr)
         );
     ConfigureAllowedCodes();
 }