/// <summary>
        /// Called when the window is Enabled.
        /// </summary>
        public void OnEnable()
        {
            layoutProfiles = CinemaMocapLayout.LoadMetaData();
            if (layoutProfiles.Count < 1)
            {
                Debug.LogError(NO_LAYOUT_PROFILES_FOUND_MSG);
                return;
            }

            mocapWorkflowPhase = GetUserDefaultWorkflow();


            if (mocapWorkflowPhase == MocapWorkflow.Record)
            {
                mocapPipeline = new RecordPipeline(true);
            }
            else
            {
                mocapPipeline = new ReviewPipeline(true);
            }

            showInputSettings     = new AnimBool(true, Repaint);
            showMappingSettings   = new AnimBool(true, Repaint);
            showOutputSettings    = new AnimBool(true, Repaint);
            showRecordingSettings = new AnimBool(true, Repaint);

            foldoutStyle = skin.FindStyle("SettingsFoldout");
            if (foldoutStyle == null)
            {
                foldoutStyle = skin.FindStyle("box");
            }
        }
        //#region Developer Mode
        //private bool isDeveloperModeEnabled = false;
        //#endregion

        /// <summary>
        /// Called when the window is opened.
        /// Initializes all variables and sets up the system.
        /// </summary>
        public void Awake()
        {
            // Setup window
#if UNITY_5 && !UNITY_5_0 || UNITY_2017_1_OR_NEWER
            base.titleContent = new GUIContent(TITLE);
#else
            base.title = TITLE;
#endif
            string res_dir = "Cinema Suite/Cinema Mocap/";
            skin         = EditorGUIUtility.Load(res_dir + "CinemaMocap_ProSkin.guiskin") as GUISkin;
            this.minSize = new Vector2(680, 400f);

            // Load UI Images
            string settingsIconName = EditorGUIUtility.isProSkin ? "CinemaMocap_SettingsIcon" : "CinemaMocap_SettingsIcon_Personal";
            settingsIcon = (Texture2D)EditorGUIUtility.Load(res_dir + settingsIconName + ".png");
            if (settingsIcon == null)
            {
                UnityEngine.Debug.LogWarning(string.Format("{0} is missing from Resources folder.", settingsIconName));
            }

            layoutProfiles = CinemaMocapLayout.LoadMetaData();
            if (layoutProfiles.Count < 1)
            {
                Debug.LogError(NO_LAYOUT_PROFILES_FOUND_MSG);
                return;
            }

            // Load Preferences
            if (EditorPrefs.HasKey(CinemaMocapSettingsWindow.LayoutKey))
            {
                string label  = EditorPrefs.GetString(CinemaMocapSettingsWindow.LayoutKey);
                int    result = layoutProfiles.FindIndex(item => item.Label == label);
                layoutProfileSelection = result;
            }
            //if (EditorPrefs.HasKey(CinemaMocapSettingsWindow.DeveloperModeKey))
            //{
            //    isDeveloperModeEnabled = EditorPrefs.GetBool(CinemaMocapSettingsWindow.DeveloperModeKey);
            //}
        }