/// <summary> /// Gets the current vector value of the axis with the specified key. /// </summary> /// <param name="axisKey">The key of the axis.</param> /// <returns>Axis value.</returns> public FVector GetVectorAxisValue(FKey axisKey) { FVector result; Native_UInputComponent.GetVectorAxisValue(Address, ref axisKey, out result); return(result); }
/// <summary> /// Binds a gesture event to a delegate function. /// Returned reference is only guaranteed to be valid until another gesture event is bound. /// </summary> public FInputGestureBindingHandle BindGesture(FKey gestureKey, FInputGestureHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { return((FInputGestureBindingHandle)Native_UInputComponent.BindGesture( Address, ref gestureKey, obj.Address, functionAddress)); } return(default(FInputGestureBindingHandle)); }
public FInputTouchBindingHandle BindTouch(EInputEventType keyEvent, FInputTouchHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { return((FInputTouchBindingHandle)Native_UInputComponent.BindTouch( Address, (byte)keyEvent, obj.Address, functionAddress)); } return(default(FInputTouchBindingHandle)); }
/// <summary> /// Binds a delegate function to a vector axis key (e.g. Tilt) /// Returned reference is only guaranteed to be valid until another vector axis key is bound. /// </summary> public FInputVectorAxisBindingHandle BindVectorAxis(FKey axisKey, FInputVectorAxisHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { return((FInputVectorAxisBindingHandle)Native_UInputComponent.BindVectorAxis( Address, ref axisKey, obj.Address, functionAddress)); } return(default(FInputVectorAxisBindingHandle)); }
/// <summary> /// Binds a delegate function an Axis defined in the project settings. /// Returned reference is only guaranteed to be valid until another axis is bound. /// </summary> public FInputAxisBindingHandle BindAxis(string axisName, FInputAxisHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { FName axisFName = (FName)axisName; return((FInputAxisBindingHandle)Native_UInputComponent.BindAxis( Address, ref axisFName, obj.Address, functionAddress)); } return(default(FInputAxisBindingHandle)); }
/// <summary> /// Binds a delegate function to an Action defined in the project settings. /// Returned reference is only guaranteed to be valid until another action is bound. /// </summary> public FInputActionBindingHandle BindAction(string actionName, EInputEventType keyEvent, FInputActionHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { FName actionFName = (FName)actionName; return((FInputActionBindingHandle)Native_UInputComponent.BindAction( Address, ref actionFName, (byte)keyEvent, obj.Address, functionAddress)); } return(default(FInputActionBindingHandle)); }
/// <summary> /// Binds a chord event to a delegate function. /// Returned reference is only guaranteed to be valid until another input key is bound. /// </summary> public FInputKeyBindingHandle BindKey(FInputChord inputChord, EInputEventType keyEvent, FInputActionHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { return((FInputKeyBindingHandle)Native_UInputComponent.BindKeyChord( Address, ref inputChord.Key, inputChord.Shift, inputChord.Ctrl, inputChord.Alt, inputChord.Cmd, (byte)keyEvent, obj.Address, functionAddress)); } return(default(FInputKeyBindingHandle)); }
/// <summary> /// Binds a key event to a delegate function. /// Returned reference is only guaranteed to be valid until another input key is bound. /// </summary> public FInputKeyBindingHandle BindKey(FKey key, EInputEventType keyEvent, FInputActionHandler handler) { IntPtr functionAddress; UObject obj; if (NativeReflection.LookupTable.GetFunctionAddress(handler, out functionAddress, out obj)) { return((FInputKeyBindingHandle)Native_UInputComponent.BindKey( Address, ref key, (byte)keyEvent, obj.Address, functionAddress)); } else { LogFunctionNotFound("BindKey", keyEvent.ToString(), handler); } return(default(FInputKeyBindingHandle)); }
/// <summary> /// Indicates that the InputComponent is interested in knowing/consuming a vector axis key's /// value (via GetVectorAxisKeyValue) but does not want a delegate function called each frame. /// Returned reference is only guaranteed to be valid until another vector axis key is bound. /// </summary> public FInputVectorAxisBindingHandle BindVectorAxis(FKey axisKey) { return((FInputVectorAxisBindingHandle)Native_UInputComponent.BindVectorAxisKey(Address, ref axisKey)); }
/// <summary> /// Indicates that the InputComponent is interested in knowing the Axis value /// (via GetAxisValue) but does not want a delegate function called each frame. /// Returned reference is only guaranteed to be valid until another axis is bound. /// </summary> public FInputAxisBindingHandle BindAxis(string axisName) { FName axisFName = (FName)axisName; return((FInputAxisBindingHandle)Native_UInputComponent.BindAxisName(Address, ref axisFName)); }
/// <summary> /// Clears all cached binding values. /// </summary> public void ClearBindingValues() { Native_UInputComponent.ClearBindingValues(Address); }
/// <summary> /// Adds the specified action binding. /// </summary> /// <param name="binding">The binding to add.</param> /// <returns>The last binding in the list.</returns> public FInputActionBindingHandle AddActionBinding(FInputActionBindingHandle binding) { return((FInputActionBindingHandle)Native_UInputComponent.AddActionBinding(Address, binding.Address)); }
/// <summary> /// Gets the number of action bindings. /// </summary> /// <returns>Number of bindings.</returns> public int GetNumActionBindings() { return(Native_UInputComponent.GetNumActionBindings(Address)); }
/// <summary> /// Gets the action binding with the specified index. /// </summary> /// <param name="bindingIndex">The index of the binding to get.</param> /// <returns></returns> public FInputActionBindingHandle GetActionBinding(int bindingIndex) { return((FInputActionBindingHandle)Native_UInputComponent.GetActionBinding(Address, bindingIndex)); }
/// <summary> /// Gets the current value of the axis with the specified name. /// </summary> /// <param name="axisName">The name of the axis.</param> /// <returns>Axis value.</returns> public float GetAxisValue(FName axisName) { return(Native_UInputComponent.GetAxisValue(Address, ref axisName)); }
/// <summary> /// Gets the current value of the axis with the specified key. /// </summary> /// <param name="axisKey">The key of the axis.</param> /// <returns>Axis value.</returns> public float GetAxisKeyValue(FKey axisKey) { return(Native_UInputComponent.GetAxisKeyValue(Address, ref axisKey)); }
/// <summary> /// Removes the action binding at the specified index. /// </summary> /// <param name="bindingIndex">The index of the binding to remove.</param> public void RemoveActionBinding(int bindingIndex) { Native_UInputComponent.RemoveActionBinding(Address, bindingIndex); }
/// <summary> /// Checks whether this component has any input bindings. /// </summary> /// <returns>true if any bindings are set, false otherwise.</returns> public bool HasBindings() { return(Native_UInputComponent.HasBindings(Address)); }
/// <summary> /// Removes given action binding for the given name. /// </summary> /// <param name="name">The name of the binding to remove.</param> public void RemoveActionBinding(FName name) { Native_UInputComponent.RemoveActionBindingByName(Address, ref name); }
/// <summary> /// Removes all action bindings. /// </summary> public void ClearActionBindings() { Native_UInputComponent.ClearActionBindings(Address); }
/// <summary> /// Removes the given action binding. /// </summary> /// <param name="binding">The action binding to remove.</param> public void RemoveActionBinding(FInputActionBindingHandle binding) { Native_UInputComponent.RemoveActionBindingByHandle(Address, binding.Address); }