Beispiel #1
0
        private InputContext GetByContext(InputContexts context)
        {
            InputContext c;

            if (!contexts.TryGetValue(context, out c))
            {
                Debug.LogError(String.Format("Input Manager doesn't have {0} context. That's not supposed to happen.", context.ToString()));
                return(null);
            }
            return(c);
        }
Beispiel #2
0
 public void DisableEvent(InputContexts context, InputButtons button, InputButtonActions action)
 {
     GetByContext(context).DisableButton(button, action);
 }
Beispiel #3
0
 public void RegisterEvent(InputContexts context, InputAxes axis, Action <float> callback)
 {
     currentContext.RegisterAxis(axis, callback);
 }
Beispiel #4
0
 public void RegisterEvent(InputContexts context, InputButtons button, InputButtonActions action, Action callback)
 {
     GetByContext(context).RegisterButton(button, action, callback);
 }
Beispiel #5
0
 public void SetContext(InputContexts newContext)
 {
     Context = newContext;
     contexts.TryGetValue(newContext, out currentContext);
 }
Beispiel #6
0
 public void EnableEvent(InputContexts context, InputAxes axis)
 {
     GetByContext(context).EnableAxis(axis);
 }