protected void OnEnable()
        {
            _gcAvStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_AV));
            _gcLaStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_LA));
            _gcLvStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_LV));

            _gcAvMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_AV, MOTION_AV_UNITS));
            _gcLaMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_LA, MOTION_LA_UNITS));
            _gcLvMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_LV, MOTION_LV_UNITS));

            _gcAvMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_AV, MOTION_AV_UNITS));
            _gcLaMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_LA, MOTION_LA_UNITS));
            _gcLvMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_LV, MOTION_LV_UNITS));

            _gcAvSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_AV));
            _gcLaSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_LA));
            _gcLvSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_LV));

            _pTarget = serializedObject.FindProperty("motionTarget");

            _pFxColor         = serializedObject.FindProperty("effectColor");
            _pFxCover         = serializedObject.FindProperty("effectCoverage");
            _pFxFeather       = serializedObject.FindProperty("effectFeather");
            _pFxSkybox        = serializedObject.FindProperty("effectSkybox");
            _pApplyColorToBkg = serializedObject.FindProperty("applyColorToBackground");

            _pAvUse    = serializedObject.FindProperty("useAngularVelocity");
            _pAvStr    = serializedObject.FindProperty("angularVelocityStrength");
            _pAvMin    = serializedObject.FindProperty("angularVelocityMin");
            _pAvMax    = serializedObject.FindProperty("angularVelocityMax");
            _pAvSmooth = serializedObject.FindProperty("angularVelocitySmoothing");

            _pLaUse    = serializedObject.FindProperty("useAcceleration");
            _pLaStr    = serializedObject.FindProperty("accelerationStrength");
            _pLaMin    = serializedObject.FindProperty("accelerationMin");
            _pLaMax    = serializedObject.FindProperty("accelerationMax");
            _pLaSmooth = serializedObject.FindProperty("accelerationSmoothing");

            _pLvUse    = serializedObject.FindProperty("useVelocity");
            _pLvStr    = serializedObject.FindProperty("velocityStrength");
            _pLvMin    = serializedObject.FindProperty("velocityMin");
            _pLvMax    = serializedObject.FindProperty("velocityMax");
            _pLvSmooth = serializedObject.FindProperty("velocitySmoothing");

            _tb = (TunnellingBase)target;

            _headerLogo = VrTunnellingProEditorUtils.LoadTexture(HEADER_LOGO_NAME);

            _fiDebugMotion   = typeof(TunnellingBase).GetField("_debugMotionCalculations", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugAv       = typeof(TunnellingBase).GetField("_debugAv", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugLa       = typeof(TunnellingBase).GetField("_debugLa", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugLv       = typeof(TunnellingBase).GetField("_debugLv", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugForceOn  = typeof(TunnellingBase).GetField("_debugForceOn", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugForceVal = typeof(TunnellingBase).GetField("_debugForceValue", BindingFlags.Instance | BindingFlags.NonPublic);

            CacheProperties();

            EditorApplication.update += OnEditorUpdate;
        }
        protected void OnEnable()
        {
            _tb         = (TunnellingBase)target;
            _headerLogo = VrtpEditorUtils.LoadTexture(HEADER_LOGO_NAME);

            InitAps(
                _pTarget, _pFxColor, _pFxCover, _pFxFeather, _pFxSkybox, _pApplyColorToBkg,
                _pAvUse, _pAvStr, _pAvMin, _pAvMax, _pAvSmooth,
                _pLaUse, _pLaStr, _pLaMin, _pLaMax, _pLaSmooth,
                _pLvUse, _pLvStr, _pLvMin, _pLvMax, _pLvSmooth,
                _pCounterMotion, _pCounterRotStr, _pCounterRotAxs,
                _pMotionEffectTarget,
                _pArtTilt, _pArtTiltStr, _pArtTiltMax, _pArtTiltSmooth,
                _pDivFps, _pDivTrans, _pDivRot
                );

            SectionToggle.Init(serializedObject, _showMotionDetection, _showMotionEffects);

            #region Motion detection labels
            _gcAvStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_AV));
            _gcLaStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_LA));
            _gcLvStr = new GUIContent(MOTION_STRENGTH, string.Format(MOTION_STR_FMT, MOTION_LV));

            _gcAvMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_AV, MOTION_AV_UNITS));
            _gcLaMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_LA, MOTION_LA_UNITS));
            _gcLvMin = new GUIContent(MOTION_MIN, string.Format(MOTION_MIN_FMT, MOTION_LV, MOTION_LV_UNITS));

            _gcAvMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_AV, MOTION_AV_UNITS));
            _gcLaMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_LA, MOTION_LA_UNITS));
            _gcLvMax = new GUIContent(MOTION_MAX, string.Format(MOTION_MAX_FMT, MOTION_LV, MOTION_LV_UNITS));

            _gcAvSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_AV));
            _gcLaSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_LA));
            _gcLvSmooth = new GUIContent(MOTION_SMOOTH, string.Format(MOTION_SMOOTH_FMT, MOTION_LV));
            #endregion

            _fiDebugMotion   = typeof(TunnellingBase).GetField("_debugMotionCalculations", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugAv       = typeof(TunnellingBase).GetField("_debugAv", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugLa       = typeof(TunnellingBase).GetField("_debugLa", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugLv       = typeof(TunnellingBase).GetField("_debugLv", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugForceOn  = typeof(TunnellingBase).GetField("_debugForceOn", BindingFlags.Instance | BindingFlags.NonPublic);
            _fiDebugForceVal = typeof(TunnellingBase).GetField("_debugForceValue", BindingFlags.Instance | BindingFlags.NonPublic);

            CacheProperties();

            EditorApplication.update += OnEditorUpdate;
        }