/// @brief Initializes everything
    /// 
    /// This is a mono-behavior Awake which is used to initialize everything. Note that since internal objects
    /// such as the context are singleton, they are constructed before BUT they are initialized here.
    /// This means that before the Awake function is called, all public members (such as m_Logger, m_query 
    /// and m_XMLFileName) must have been initialized and that no one can use NIConfigurableContext before this
    /// is finished.     
    public void Awake()
    {
        m_context = NIContext.Instance;
        if(m_context.Valid==false)
        {
            // we need to initialize...
            if (m_context.Init(m_Logger, m_query, m_XMLFileName, m_recordingFilename) == false)
            {
                m_Logger.Log("FAILED TO INITIALIZE CONTEXT!!!", NIEventLogger.Categories.Initialization, NIEventLogger.Sources.BaseObjects, NIEventLogger.VerboseLevel.Errors);
                return;
            }
        }
        try
        {
            Mirror = m_initMirroring;
        }
        catch (System.Exception e)
        {
            Debug.Log("Failed to set mirroring. Are you using an XML initialization from a recording without setting the playback option in the inspector?");
            throw e;
        }

        m_image = NIImage.Instance;
        if (m_useImageGenerator)
            m_image.Init(m_Logger, m_context);
        else m_image.Dispose(); // to make sure it is invalid
        m_userAndSkeletonControl = NIUserAndSkeleton.Instance;
        if (m_useSkeleton)
        {
            m_userAndSkeletonControl.Init(m_Logger, m_context);
            m_userAndSkeletonControl.SkeletonSmoothingFactor = m_smoothingFactor;
        }
        else m_userAndSkeletonControl.Dispose(); // to make sure it is invalid
        UpdateNodeInformation();
    }