Пример #1
0
 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 ? ">" : "_"));
 }
Пример #2
0
 public Command(double t, int s, InputChord i1, InputChord i2)
 {
     timingScore = t;
     syncCount   = s;
     input1      = i1;
     input2      = i2;
 }
Пример #3
0
 void OnSubBeat(double beat)
 {
     inputs.Add(chordBuffer);
     //Debug.Log("registered chord " + chordBuffer.Stringify());
     chordBuffer = InputChord.None;
     currentNotes.Clear();
     PopulateCurrentNotes();
 }
Пример #4
0
            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));;
            }
        }
Пример #5
0
            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)));
            }
        }
Пример #6
0
    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);
        }
    }
Пример #7
0
    // 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();
    }
Пример #8
0
        // 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);
            }
        }
Пример #9
0
 ///<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);
Пример #10
0
 public Command()
 {
     timingScore = 0;
     syncCount   = 0;
     input1      = input2 = InputChord.None;
 }
Пример #11
0
 ///<summary>Sets the currently selected key.</summary>
 public void SetSelectedKey(InputChord InSelectedKey) =>
 InputKeySelector_methods.SetSelectedKey_method.Invoke(ObjPointer, InSelectedKey);