breakpoint
before update unity version
This commit is contained in:
@@ -23,13 +23,26 @@ namespace BITKit
|
||||
public readonly ValidHandle allowInput = new();
|
||||
private readonly ConcurrentDictionary<string,InputAction> actions = new();
|
||||
|
||||
/// <summary>
|
||||
/// 注册所有(started,performed,canceled)回调
|
||||
/// </summary>
|
||||
/// <param name="reference"></param>
|
||||
/// <param name="callback"></param>
|
||||
/// <returns></returns>
|
||||
public InputActionGroup RegisterCallback(InputActionReference reference,
|
||||
Action<InputAction.CallbackContext> callback)
|
||||
{
|
||||
var action = EnsureCreated(reference);
|
||||
action.RegisterCallback(callback);
|
||||
return this;
|
||||
}
|
||||
|
||||
public InputAction EnsureCreated(InputActionReference reference)
|
||||
{
|
||||
if (reference is null)
|
||||
{
|
||||
Debug.LogWarning($"未知的引用");
|
||||
return this;
|
||||
return null;
|
||||
}
|
||||
|
||||
EnsureConfiguration();
|
||||
@@ -39,12 +52,12 @@ namespace BITKit
|
||||
newAction.Rename(reference.name);
|
||||
return newAction;
|
||||
});
|
||||
action.RegisterCallback(callback);
|
||||
|
||||
allowInput.Invoke();
|
||||
|
||||
|
||||
return this;
|
||||
return action;
|
||||
}
|
||||
|
||||
public void Inherit(InputActionGroup other)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
Reference in New Issue
Block a user