コード例 #1
0
ファイル: CriAtom.cs プロジェクト: TakumiKimura/MusicGame
    /* プラグイン内部用API */
    public static void SetEventCallback(CriAtomExSequencer.EventCbFunc func, string separator)
    {
#if CRIWARE_SUPPORT_SEQUENCE_CALLBACK
        /* ネイティブプラグインに関数ポインタを登録 */
        IntPtr ptr = IntPtr.Zero;
        eventUserCbFunc = func;
        if (func != null)
        {
        #if CRIWARE_CALLBACK_IMPL_UNITYSENDMESSAGE
            ptr = IntPtr.Zero;
        #elif CRIWARE_CALLBACK_IMPL_NATIVE2MANAGED
            CriAtomExSequencer.EventCbFunc localFunc;
            localFunc = new CriAtomExSequencer.EventCbFunc(CriAtom.instance.EventCallbackFromNative);
            ptr       = Marshal.GetFunctionPointerForDelegate(localFunc);
        #endif
            CriAtomPlugin.criAtomUnitySeqencer_SetEventCallback(ptr, CriAtom.instance.gameObject.name, "EventCallbackFromNative", separator);
        }
#elif CRIWARE_UNSUPPORT_SEQUENCE_CALLBACK
        Debug.LogError("This platform does not support event callback feature.");
#endif
    }