コード例 #1
0
        /// <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");
            }
        }
コード例 #2
0
        /// <summary>
        /// Draw the window's toolbar.
        /// </summary>
        /// <param name="toolbar">The toolbar's area.</param>
        private void DrawToolbar(Rect toolbar)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.Width(toolbar.width));

            //if (isDeveloperModeEnabled)
            {
                MocapWorkflow tempWorkflow = (MocapWorkflow)EditorGUILayout.EnumPopup(mocapWorkflowPhase, EditorStyles.toolbarDropDown);
                if (tempWorkflow != mocapWorkflowPhase)
                {
                    mocapWorkflowPhase = tempWorkflow;

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

            GUIContent[] content = new GUIContent[layoutProfiles.Count];
            for (int i = 0; i < layoutProfiles.Count; i++)
            {
                content[i] = new GUIContent(layoutProfiles[i].Label);
            }
            GUILayout.FlexibleSpace();

            int tempSelection = EditorGUILayout.Popup(new GUIContent(string.Empty, "Layout"), layoutProfileSelection, content, EditorStyles.toolbarDropDown, GUILayout.Width(120));

            if (layoutProfileSelection != tempSelection || mocapPipeline.LayoutProfile == null)
            {
                mocapPipeline.LayoutProfile = Activator.CreateInstance(layoutProfiles[tempSelection].Type) as CinemaMocapLayout;
                if (mocapPipeline.InputProfile != null)
                {
                    mocapPipeline.LayoutProfile.AspectRatio = mocapPipeline.InputProfile.AspectRatio;
                }
                layoutProfileSelection = tempSelection;
            }

            if (GUILayout.Button(new GUIContent(settingsIcon, "Settings"), EditorStyles.toolbarButton))
            {
                EditorWindow.GetWindow(typeof(CinemaMocapSettingsWindow));
            }

            // Check if the Welcome Window exists and if so, show an icon for it.
            var helpWindowType = Type.GetType("CinemaSuite.CinemaSuiteWelcome");

            if (helpWindowType != null)
            {
                if (GUILayout.Button(new GUIContent("?", "Help"), EditorStyles.toolbarButton))
                {
                    EditorWindow.GetWindow(helpWindowType);
                }
            }

            EditorGUILayout.EndHorizontal();
        }