public static void ShowVideo(string videoAssetPath, Action onVideoWindowClose = null) { var window = (VideoWindow)ScriptableObject.CreateInstance <VideoWindow>(); window.playingClip = AssetDatabase.LoadAssetAtPath <VideoClip>(videoAssetPath); window.previewID = VideoUtil.PlayPreview(window.playingClip); Vector2 size = new Vector2(window.playingClip.width * videoClipSizeScale, window.playingClip.height * videoClipSizeScale); window.maxSize = window.minSize = size; window.position = VideoUtil.GetMainWindowCenteredPosition(size); window.titleContent = new GUIContent("VideoWindow"); window.ShowPopup(); window.Focus(); window.onVideoWindowClosed = onVideoWindowClose; instance = window; }