// Deinitialize the tracker when the Behaviour is destroyed.
    void OnDestroy()
    {
        // unregister from the QCARBehaviour
        QCARBehaviour qcarBehaviour = (QCARBehaviour)FindObjectOfType(typeof(QCARBehaviour));

        if (qcarBehaviour)
        {
            qcarBehaviour.UnregisterTrackerEventHandler(this);
        }
    }
Exemplo n.º 2
0
    private void loadGame()
    {
        QCARBehaviour qcarBehaviour = GetComponent <QCARBehaviour>();

        if (qcarBehaviour)
        {
            qcarBehaviour.UnregisterTrackerEventHandler(this);
        }

        Application.LoadLevel(Application.loadedLevel + 1);
    }
    /// <summary>
    /// When this game object is destroyed, the target finder gets deinitialized and the class unregisters itself as event handler
    /// </summary>
    void OnDestroy()
    {
        // only if QCAR hasn't already been deinitialized
        if (QCARManager.Instance.Initialized)
        {
            if (mOnInitializedCalled)
            {
                Deinitialize();
            }
        }

        QCARBehaviour qcarBehaviour = (QCARBehaviour)FindObjectOfType(typeof(QCARBehaviour));

        if (qcarBehaviour)
        {
            qcarBehaviour.UnregisterTrackerEventHandler(this);
        }
    }
    // Deinitialize the tracker when the Behaviour is destroyed.
    void OnDestroy()
    {
        // unregister from the QCARBehaviour
        QCARBehaviour qcarBehaviour = (QCARBehaviour)FindObjectOfType(typeof(QCARBehaviour));

        if (qcarBehaviour)
        {
            qcarBehaviour.UnregisterTrackerEventHandler(this);
        }

        // unload word list which was specific to this behaviour
        var tracker = TrackerManager.Instance.GetTracker(Tracker.Type.TEXT_TRACKER);

        if (tracker != null)
        {
            var wordList = ((TextTracker)tracker).WordList;
            wordList.UnloadAllLists();
        }
    }