Ejemplo n.º 1
0
    public static void SetBeatSyncCallback(CriAtomExBeatSync.CbFunc func)
    {
#if CRIWARE_SUPPORT_NATIVE_CALLBACK
        /* ネイティブプラグインに関数ポインタを登録 */
        IntPtr ptr = IntPtr.Zero;
        beatsyncUserCbFunc = func;
        if (func != null)
        {
            CriAtomExBeatSync.CbFunc delegateObject;
            delegateObject = new CriAtomExBeatSync.CbFunc(CriAtom.BeatSyncCallbackFromNative);
            ptr            = Marshal.GetFunctionPointerForDelegate(delegateObject);
        }
        CriAtomPlugin.criAtomUnity_SetBeatSyncCallback(ptr);
#else
        Debug.LogError("[CRIWARE] Beat sync callback is not supported for this scripting backend.");
#endif
    }