Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6a4f489
Added Unity 6 Support
DryreL Jan 3, 2026
075cae7
Ignore exported files
DryreL Jan 3, 2026
85e6135
Package versions updated
DryreL Jan 3, 2026
c16eb0d
ProjectSettings updated (Unity 6)
DryreL Jan 3, 2026
757169a
VideoPlayableBehaviour - Resize to Reinitialize (Unity 6)
DryreL Jan 3, 2026
aeb8397
WindowData asset created
DryreL Jan 3, 2026
9ce229d
TextMesh Pro updated (Unity 6)
DryreL Jan 3, 2026
535dd80
SampleScene updated w/other small auto updates
DryreL Jan 3, 2026
392be3e
Deprecated Visual Studio Code Editor package removed
DryreL Jan 3, 2026
db1fe7c
Some unnecessary packages removed for the Demo project
DryreL Jan 3, 2026
84dbcd2
Timeline package version updated
DryreL Jan 3, 2026
7482af1
Scene postprocessing layer set to Default
DryreL Jan 3, 2026
9a15761
/.vscode added to Gitignore
DryreL Jan 3, 2026
6a5a9d9
ModifiedDefaultPlayables - Subtitle Track created (SRT Importer)
DryreL Jan 3, 2026
2f65ba3
Subtitle Track added to Timeline & Scene for testing
DryreL Jan 3, 2026
7d5fade
Unity Localization package enabled
DryreL Jan 3, 2026
4a23ae7
Unity Localization package assets auto-imported
DryreL Jan 3, 2026
2556234
SubtitleTrackEditor - Auto string table creation & binding for locali…
DryreL Jan 3, 2026
742a604
Localization Settings created
DryreL Jan 3, 2026
cb2344c
AddressableAssetsData auto-update
DryreL Jan 3, 2026
87e6f14
SampleScene auto-update
DryreL Jan 3, 2026
bedda16
addressables.android package enabled
DryreL Jan 3, 2026
0fe3d75
Default en locale created
DryreL Jan 3, 2026
f5d3732
ExampleSignalLogger created and added to Timeline
DryreL Jan 3, 2026
bd981fa
TimelineControlUI script created
DryreL Jan 3, 2026
92676cb
StreamingAssets URL video play feature added (cross-platform)
DryreL Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ public override float GetPropertyHeight (SerializedProperty property, GUIContent

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}
Comment on lines +17 to +21

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GUI.color to control label text color is incorrect. GUI.color is a tint that affects all GUI elements including backgrounds, borders, and textures. For controlling text color specifically in PropertyDrawers, you should use the GUIStyle.normal.textColor property or leave the default styling which Unity handles automatically. This implementation may cause unintended visual effects on other GUI elements.

Copilot uses AI. Check for mistakes.

SerializedProperty colorProp = property.FindPropertyRelative("color");
SerializedProperty intensityProp = property.FindPropertyRelative("intensity");
SerializedProperty bounceIntensityProp = property.FindPropertyRelative("bounceIntensity");
Expand All @@ -29,5 +36,7 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte

singleFieldRect.y += EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(singleFieldRect, rangeProp);

GUI.color = originalLabelColor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,18 @@ public override float GetPropertyHeight (SerializedProperty property, GUIContent

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}

SerializedProperty colorProp = property.FindPropertyRelative("color");

Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, colorProp);

GUI.color = originalLabelColor;
Comment on lines +17 to +29

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GUI.color to control label text color is incorrect. GUI.color is a tint that affects all GUI elements including backgrounds, borders, and textures. For controlling text color specifically in PropertyDrawers, you should use the GUIStyle.normal.textColor property or leave the default styling which Unity handles automatically. This implementation may cause unintended visual effects on other GUI elements.

Suggested change
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}
SerializedProperty colorProp = property.FindPropertyRelative("color");
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, colorProp);
GUI.color = originalLabelColor;
SerializedProperty colorProp = property.FindPropertyRelative("color");
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, colorProp);

Copilot uses AI. Check for mistakes.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ public override float GetPropertyHeight (SerializedProperty property, GUIContent

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}
Comment on lines +18 to +22

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GUI.color to control label text color is incorrect. GUI.color is a tint that affects all GUI elements including backgrounds, borders, and textures. For controlling text color specifically in PropertyDrawers, you should use the GUIStyle.normal.textColor property or leave the default styling which Unity handles automatically. This implementation may cause unintended visual effects on other GUI elements.

Copilot uses AI. Check for mistakes.

SerializedProperty colorProp = property.FindPropertyRelative("color");
SerializedProperty fontSizeProp = property.FindPropertyRelative("fontSize");
SerializedProperty textProp = property.FindPropertyRelative("text");
Expand All @@ -26,5 +33,7 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte

singleFieldRect.y += EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(singleFieldRect, textProp);

GUI.color = originalLabelColor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ public override float GetPropertyHeight (SerializedProperty property, GUIContent

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}

SerializedProperty timeScaleProp = property.FindPropertyRelative("timeScale");

Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, timeScaleProp);

GUI.color = originalLabelColor;
Comment on lines +15 to +27

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GUI.color to control label text color is incorrect. GUI.color is a tint that affects all GUI elements including backgrounds, borders, and textures. For controlling text color specifically in PropertyDrawers, you should use the GUIStyle.normal.textColor property or leave the default styling which Unity handles automatically. This implementation may cause unintended visual effects on other GUI elements.

Suggested change
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}
SerializedProperty timeScaleProp = property.FindPropertyRelative("timeScale");
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, timeScaleProp);
GUI.color = originalLabelColor;
SerializedProperty timeScaleProp = property.FindPropertyRelative("timeScale");
Rect singleFieldRect = new Rect(position.x, position.y, position.width, EditorGUIUtility.singleLineHeight);
EditorGUI.PropertyField(singleFieldRect, timeScaleProp);

Copilot uses AI. Check for mistakes.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ public override float GetPropertyHeight (SerializedProperty property, GUIContent

public override void OnGUI (Rect position, SerializedProperty property, GUIContent label)
{
// Support dark/light mode for label text
Color originalLabelColor = GUI.color;
if (!EditorGUIUtility.isProSkin)
{
GUI.color = new Color(0, 0, 0, 1); // Black for light mode
}
Comment on lines +24 to +28

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using GUI.color to control label text color is incorrect. GUI.color is a tint that affects all GUI elements including backgrounds, borders, and textures. For controlling text color specifically in PropertyDrawers, you should use the GUIStyle.normal.textColor property or leave the default styling which Unity handles automatically. This implementation may cause unintended visual effects on other GUI elements.

Copilot uses AI. Check for mistakes.

SerializedProperty tweenPositionProp = property.FindPropertyRelative ("tweenPosition");
SerializedProperty tweenRotationProp = property.FindPropertyRelative("tweenRotation");
SerializedProperty tweenTypeProp = property.FindPropertyRelative ("tweenType");
Expand All @@ -40,5 +47,7 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte
singleFieldRect.y += EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField (singleFieldRect, customCurveProp, m_CustomCurveContent);
}

GUI.color = originalLabelColor;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public override void OnInspectorGUI()
{
VideoScriptPlayableAsset videoAsset = (VideoScriptPlayableAsset)target;
GUIStyle lStyle = GetLabelStyle();

// Ensure label color is set for dark/light mode compatibility
if (lStyle.normal.textColor == Color.black)
{
lStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
}

Comment on lines +27 to 32

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will always be false in light mode. The GetLabelStyle() method already sets the textColor based on the editor skin (line 89), so checking if it equals Color.black and then setting it again is redundant and won't work as expected. This check should be removed since the text color is already properly set in GetLabelStyle().

Suggested change
// Ensure label color is set for dark/light mode compatibility
if (lStyle.normal.textColor == Color.black)
{
lStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
}

Copilot uses AI. Check for mistakes.
GUILayout.Label("UI RawImage to play the video on:", lStyle);
EditorGUILayout.PropertyField(rawImage);
Expand Down Expand Up @@ -79,6 +85,8 @@ private GUIStyle GetLabelStyle ()
{
GUIStyle labelStyle = new GUIStyle();
labelStyle.wordWrap = true;
// Support both light and dark modes
labelStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
return labelStyle;
}
}
39 changes: 25 additions & 14 deletions Assets/VideoEditorAssets/Scripts/Editor/GameViewUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ static GameViewUtils()
gameViewSizesInstance = instanceProp.GetValue(null, null);
}

/// <summary>
/// Ensures the value is even (required for MP4/H.264 encoding)
/// </summary>
private static int MakeEven(int value)
{
return (value % 2 == 0) ? value : value + 1;
}

public static void AddSetSize(int width, int height)
{
// MP4 format requires even dimensions for H.264 codec
width = MakeEven(width);
height = MakeEven(height);

int idx = FindSize(GameViewSizeGroupType.Standalone, width, height);
if (idx == -1)
{
Expand Down Expand Up @@ -58,25 +70,24 @@ public static void AddCustomSize(GameViewSizeType viewSizeType, GameViewSizeGrou
var group = GetGroup(sizeGroupType);
var addCustomSize = getGroup.ReturnType.GetMethod("AddCustomSize"); // or group.GetType().
var gvsType = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSize");
#if NET_4_6
var ctor = gvsType.GetConstructor(new Type[] { typeof(Editor).Assembly.GetType("UnityEditor.GameViewSizeType"), typeof(int), typeof(int), typeof(string) });
var newGvsType = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSizeType");
if (viewSizeType == GameViewSizeType.AspectRatio)

// Unity 6 and modern Unity versions use the constructor with GameViewSizeType enum
var gvsTypeEnum = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSizeType");
var ctor = gvsType.GetConstructor(new Type[] { gvsTypeEnum, typeof(int), typeof(int), typeof(string) });

if (ctor != null)
{
newGvsType = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSizeType.AspectRatio");
// Modern Unity version with enum parameter
var newSize = ctor.Invoke(new object[] { (int)viewSizeType, width, height, text });
addCustomSize.Invoke(group, new object[] { newSize });
}
else
{
newGvsType = typeof(Editor).Assembly.GetType("UnityEditor.GameViewSizeType.FixedResolution");
// Fallback for older Unity versions with int parameter
ctor = gvsType.GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(string) });

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback branch may fail silently if the constructor is not found in older Unity versions. After the fallback constructor lookup, there's no null check before invoking it. If both constructor lookups fail, this will throw a NullReferenceException. Add a null check and appropriate error handling after the fallback constructor lookup.

Suggested change
ctor = gvsType.GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(string) });
ctor = gvsType.GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(string) });
if (ctor == null)
{
Debug.LogError("GameViewUtils.AddCustomSize: Unable to find a suitable UnityEditor.GameViewSize constructor for this Unity version.");
return;
}

Copilot uses AI. Check for mistakes.
var newSize = ctor.Invoke(new object[] { (int)viewSizeType, width, height, text });
addCustomSize.Invoke(group, new object[] { newSize });
}

var newSize = ctor.Invoke(new object[] { (int)viewSizeType, width, height, text });
addCustomSize.Invoke(group, new object[] { newSize });
#else
var ctor = gvsType.GetConstructor(new Type[] { typeof(int), typeof(int), typeof(int), typeof(string) });
var newSize = ctor.Invoke(new object[] { (int)viewSizeType, width, height, text });
addCustomSize.Invoke(group, new object[] { newSize });
#endif
}

public static bool SizeExists(GameViewSizeGroupType sizeGroupType, string text)
Expand Down
30 changes: 26 additions & 4 deletions Assets/VideoEditorAssets/Scripts/Editor/LayoutUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ private enum MethodType { Save, Load };

static MethodInfo GetMethod(MethodType method_type)
{

Type layout = Type.GetType("UnityEditor.WindowLayout,UnityEditor");
// In Unity 6, WindowLayout moved to UnityEditor.WindowLayout namespace
Type layout = Type.GetType("UnityEditor.WindowLayout,UnityEditor.CoreModule");

// Fallback for older Unity versions
if (layout == null)
{
layout = Type.GetType("UnityEditor.WindowLayout,UnityEditor");
}

MethodInfo save = null;
MethodInfo load = null;
Expand All @@ -37,13 +43,29 @@ static MethodInfo GetMethod(MethodType method_type)
public static void SaveLayout(string path)
{
path = Path.Combine(Directory.GetCurrentDirectory(), path);
GetMethod(MethodType.Save).Invoke(null, new object[] { path });
var method = GetMethod(MethodType.Save);
if (method != null)
{
method.Invoke(null, new object[] { path });
}
else
{
Debug.LogWarning("SaveLayout method not found. Window layout could not be saved.");
}
}

public static void LoadLayout(string path)
{
path = Path.Combine(Directory.GetCurrentDirectory(), path);
GetMethod(MethodType.Load).Invoke(null, new object[] { path, false });
var method = GetMethod(MethodType.Load);
if (method != null)
{
method.Invoke(null, new object[] { path, false });
}
else
{
Debug.LogWarning("LoadLayout method not found. Window layout could not be loaded.");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public static void Init()

public void OnGUI()
{
scrollPos = GUILayout.BeginScrollView(scrollPos);

GUIStyle hStyle = GetHeadingStyle();
GUIStyle pStyle = GetParagraphStyle();
GUIStyle bStyle = GetButtonStyle();

scrollPos = GUILayout.BeginScrollView(scrollPos);

GUILayout.Label("Unity Video Editor Template", hStyle);
GUILayout.Label("Thank you for downloading the Video Editor Template.", pStyle);
Expand All @@ -65,9 +65,26 @@ public void OnGUI()
GUILayout.EndVertical();
if (GUILayout.Button("Set Resolution", SetResButtonStyle(), GUILayout.Height(42)))
{
// MP4 format requires even dimensions
int adjustedWidth = (width % 2 == 0) ? width : width + 1;
int adjustedHeight = (height % 2 == 0) ? height : height + 1;

if (adjustedWidth != width || adjustedHeight != height)
{
width = adjustedWidth;
height = adjustedHeight;
UnityEngine.Debug.LogWarning($"Resolution adjusted to even dimensions for MP4 compatibility: {width}x{height}");
}

Comment on lines +68 to +78

Copilot AI Jan 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MP4 resolution validation is being performed twice in different locations (here and in GameViewUtils.AddSetSize). This creates inconsistent behavior: users might see a warning about adjusted dimensions from this code, but GameViewUtils.AddSetSize will adjust again silently. The validation should be performed in only one location to avoid confusion and ensure consistent behavior throughout the application.

Suggested change
// MP4 format requires even dimensions
int adjustedWidth = (width % 2 == 0) ? width : width + 1;
int adjustedHeight = (height % 2 == 0) ? height : height + 1;
if (adjustedWidth != width || adjustedHeight != height)
{
width = adjustedWidth;
height = adjustedHeight;
UnityEngine.Debug.LogWarning($"Resolution adjusted to even dimensions for MP4 compatibility: {width}x{height}");
}

Copilot uses AI. Check for mistakes.
GameViewUtils.AddSetSize(width, height);
}
GUILayout.EndHorizontal();

GUIStyle noteStyle = new GUIStyle(pStyle);
noteStyle.fontSize = 11;
noteStyle.fontStyle = FontStyle.Italic;
noteStyle.normal.textColor = EditorGUIUtility.isProSkin ? new Color(0.8f, 0.8f, 0.8f) : new Color(0.3f, 0.3f, 0.3f);
GUILayout.Label("Note: MP4 format requires even dimensions. Odd values will be automatically adjusted.", noteStyle);


GUILayout.Label("See the sample scene for example use. Specifically look at the 'GlobalTimeline' object. To export the video simply enter playmode and wait. You do not need to build anything! To see the video output settings look at the RecorderClip on in the Timeline of the 'GlobalTimeline' object.", pStyle);
Expand All @@ -80,7 +97,7 @@ public void OnGUI()
GUILayout.BeginHorizontal();
if (GUILayout.Button("YouTube Tutorials", bStyle))
{
Application.OpenURL(VideoEditorConstants.WindowLayoutPath);
Application.OpenURL(VideoEditorConstants.YouTubeLink);
}
if (GUILayout.Button("Blog Post (written documentation)", bStyle))
{
Expand Down Expand Up @@ -135,6 +152,9 @@ private GUIStyle GetHeadingStyle()
GUIStyle headingStyle = new GUIStyle();
headingStyle.fontSize = 20;
headingStyle.padding = new RectOffset(10, 10, 10, 10);
headingStyle.fontStyle = FontStyle.Bold;
// Support both light and dark modes
headingStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
return headingStyle;
}

Expand All @@ -144,6 +164,8 @@ private GUIStyle GetParagraphStyle()
paraStyle.fontSize = 14;
paraStyle.padding = new RectOffset(10, 10, 10, 10);
paraStyle.wordWrap = true;
// Support both light and dark modes
paraStyle.normal.textColor = EditorGUIUtility.isProSkin ? Color.white : Color.black;
return paraStyle;
}

Expand All @@ -159,6 +181,7 @@ private static Rect GetEditorMainWindowPos()
var windows = Resources.FindObjectsOfTypeAll(containerWinType);
foreach (var win in windows)
{
if (win == null) continue;
var showmode = (int)showModeField.GetValue(win);
if (showmode == 4) // main window
{
Expand Down