Пример #1
0
        /// <summary>
        /// Draws the video clip in the window
        /// And draws the Play/Pause buttons, the Apply button for saving the data to the video clip metadata
        /// </summary>
        private void DrawVideoClip()
        {
            videoTexture = importer.GetPreviewTexture();
            if (videoTexture == null)
            {
                return;
            }
            Vector2 size          = new Vector2(videoTexture.width, videoTexture.height) * VIDEO_SIZE_MULTIPLIER;
            Vector2 videoPosition = new Vector2(100, 10);

            videoRect = new Rect(videoPosition, size);
            bool mustPlay = GUI.Button(playButtonRect, mustPlayPreview ? "Pause" : "Play");

            if (mustPlay)
            {
                ChangePlayState();
            }
            if (mustPlayPreview)
            {
                PlayPreview();
            }
            EditorGUI.DrawPreviewTexture(videoRect, videoTexture);

            if (GUI.Button(applyButtonRect, "Apply"))
            {
                importer.userData = VideoClipEvents.ObjectToJSON(videoClipEvents);
                videoClipImporter.ApplyModifiedPropertiesWithoutUndo();
                ReImportAssets(AssetPath);
            }
        }
Пример #2
0
 public string Assign()
 {
     clipEvents = new VideoClipEvents(Count);
     foreach (EditorVideoClipEvent editorClip in editorClipEvents)
     {
         clipEvents.Add(editorClip.clipEvent);
     }
     UserData = VideoClipEvents.ObjectToJSON(clipEvents);
     return(UserData);
 }