コード例 #1
0
        public static PlaybackWindow Init()
        {
            PlaybackWindow window = (PlaybackWindow)GetWindow(typeof(PlaybackWindow));

            window.Show();
            window.Repaint();

            return(window);
        }
コード例 #2
0
        public void RenderSingleRecordingView(Recording recording)
        {
            EditorUtil
            .RenderSingleRecordingInfo(recording);

            if (GUILayout.Button("View Playback"))
            {
                PlaybackWindow
                .Init()
                .SetRecordingForPlayback(recording);
            }

            if (GUILayout.Button("Export As JSON"))
            {
                string path = EditorUtility.SaveFilePanel("Export Recording As JSON", "", recording.RecordingName + ".json", "json");
                System.IO.File.WriteAllText(path, recording.ToJSON());
                EditorUtility.RevealInFinder(path);
            }

            if (GUILayout.Button("Export As CSV"))
            {
                ExportCSVWindow.Init(recording);
            }

            if (GUILayout.Button("Export As RAP"))
            {
                string path = EditorUtility.SaveFilePanel("Export Recording As RAP", "", recording.RecordingName + ".rap", "rap");
                using (FileStream fs = File.Create(path))
                {
                    Packager.Package(fs, recording);
                }
                EditorUtility.RevealInFinder(path);
            }

            if (GUILayout.Button("Export As Unity Animation Clip"))
            {
                ExportAnimationClipWindow.Init(recording);
            }

            if (recording.Metadata != null && recording.Metadata.Count > 0)
            {
                EditorGUILayout.LabelField("Metadata:", new GUIStyle(GUI.skin.label)
                {
                    fontStyle = FontStyle.Bold,
                });
                foreach (var keyvaluePair in recording.Metadata)
                {
                    EditorGUILayout.LabelField(keyvaluePair.Key, keyvaluePair.Value);
                }
            }
        }