public static string Stringify(this InputChord ic) { return(((ic & InputChord.Left) != 0 ? "<" : "_") + ((ic & InputChord.Down) != 0 ? "v" : "_") + ((ic & InputChord.Up) != 0 ? "^" : "_") + ((ic & InputChord.Right) != 0 ? ">" : "_")); }
public Command(double t, int s, InputChord i1, InputChord i2) { timingScore = t; syncCount = s; input1 = i1; input2 = i2; }
void OnSubBeat(double beat) { inputs.Add(chordBuffer); //Debug.Log("registered chord " + chordBuffer.Stringify()); chordBuffer = InputChord.None; currentNotes.Clear(); PopulateCurrentNotes(); }
internal static unsafe void Invoke(IntPtr obj, InputChord InSelectedKey) { long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L }; byte *b = (byte *)p; *((InputChord *)(b + 0)) = InSelectedKey; Main.GetProcessEvent(obj, SetSelectedKey_ptr, new IntPtr(p));; } }
internal static unsafe bool Invoke(InputChord A, InputChord B) { long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L }; byte *b = (byte *)p; *((InputChord *)(b + 0)) = A; *((InputChord *)(b + 40)) = B; Main.GetProcessEvent(KismetInputLibrary.DefaultObject, EqualEqual_InputChordInputChord_ptr, new IntPtr(p));; return(*((bool *)(b + 80))); } }
private void RegisterSingleInput(NoteType dir, InputChord alsoDir) { chordBuffer |= alsoDir; singleInputCount++; var match = GetNextNote(dir); if (match != null) { totalTimingGap += rhythmController.TimeUntilBeat(match.beat); command.syncCount++; noteBoard.DeleteNote(match); } }
// Start is called before the first frame update void Start() { Debug.Log("InputHandler Start() was called"); noteBoard = GetComponent <NoteBoard>(); chordBuffer = InputChord.None; rhythmController.AddSubBeatCallback(OnSubBeat); rhythmController.AddOnPlayCallback(OnPlay); inputs = new List <InputChord>(); notes = new Queue <NoteData>(rhythmController.GetAllNotes()); currentNotes = new List <NoteData>(); totalTimingGap = 0; singleInputCount = 0; command = new Command(); }
// Bind a delegate directly to a specific key, gamepad button, axis, or touch input. public void BindKey(InputChord inputChord, InputEventType inputEventType, KeyInputCallback callback) { if (IsDestroyedOrPendingKill) { throw new UnrealObjectDestroyedException("Trying to bind input key on destroyed input component"); } if (null == callback) { throw new ArgumentNullException("callback"); } UnrealObject targetObj = callback.Target as UnrealObject; unsafe { byte *nativeInputChordBuffer = stackalloc byte[InputChord.NativeDataSize]; inputChord.ToNative(new IntPtr(nativeInputChordBuffer)); RegisterKeyInputCallback(NativeObject, targetObj != null ? targetObj.NativeObject : IntPtr.Zero, nativeInputChordBuffer, inputEventType, callback); } }
///<summary> ///Test if the input chords are equal (A == B) ///@ ///</summary> ///<remarks> ///param A - The chord to compare against ///@param B - The chord to compare ///@returns True if the chords are equal, false otherwise ///</remarks> public static bool EqualEqual_InputChordInputChord(InputChord A, InputChord B) => KismetInputLibrary_methods.EqualEqual_InputChordInputChord_method.Invoke(A, B);
public Command() { timingScore = 0; syncCount = 0; input1 = input2 = InputChord.None; }
///<summary>Sets the currently selected key.</summary> public void SetSelectedKey(InputChord InSelectedKey) => InputKeySelector_methods.SetSelectedKey_method.Invoke(ObjPointer, InSelectedKey);