Exemple #1
0
    public void StartNativeTouchButton()
    {
        NativeTouch.ClearCallbacks();
        NativeTouch.RegisterCallback(NativeTouchStaticReceiver);

        //We want only few essential data so that's "minimal" = not full
        NativeTouch.Start(new NativeTouch.StartOption {
            fullMode = false, disableUnityTouch = false
        });

        noCallbackEnabled = false;

#if !UNITY_EDITOR
        runningText.text = "Native touch is running (callback).";
#endif
    }
Exemple #2
0
    public void StartNativeTouchButtonRingBuffer()
    {
        NativeTouch.ClearCallbacks();

        //This does nothing, for we disable the callback below...
        NativeTouch.RegisterCallback(NativeTouchStaticReceiver);

        //To iterate the ring buffer in main thread instead of handling the callback, we could potentially disable the callback to boost performance.
        //This is important in platform like Android IL2CPP where the callback is slow and you rather ONLY iterate the ring buffer.
        NativeTouch.Start(new NativeTouch.StartOption {
            fullMode = false, disableUnityTouch = false, noCallback = true
        });

        noCallbackEnabled = true;

#if !UNITY_EDITOR
        runningText.text = "Native touch is running (no callback).";
#endif
    }
Exemple #3
0
    public void StopLatestPlay()
    {
#if NATIVE_TOUCH_INTEGRATION
        Debug.Log("Native touch started!!");
        staticPointer = nativeAudioPointer;
        NativeTouch.RegisterCallback(NTCallback);
        NativeTouch.Start(new NativeTouch.StartOption {
            disableUnityTouch = true
        });
        NativeTouch.WarmUp();
        return;
#endif
        if (NotRealDevice())
        {
            return;
        }
        if (nativeAudioController != null)
        {
            nativeAudioController.Stop();
        }
    }