Skip to content

Commit ac84dc1

Browse files
committed
Put video player components in appropriate addcomponent menu sections
- Also add example prefabs to example scene
1 parent 9467d0f commit ac84dc1

21 files changed

+644
-139
lines changed

Assets/USharpVideo/Animations/SliderController.controller

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ AnimatorController:
1414
m_DefaultFloat: 0
1515
m_DefaultInt: 0
1616
m_DefaultBool: 0
17-
m_Controller: {fileID: 0}
17+
m_Controller: {fileID: 9100000}
1818
- m_Name: Target
1919
m_Type: 3
2020
m_DefaultFloat: 0
2121
m_DefaultInt: 0
2222
m_DefaultBool: 0
23-
m_Controller: {fileID: 0}
23+
m_Controller: {fileID: 9100000}
2424
m_AnimatorLayers:
2525
- serializedVersion: 5
2626
m_Name: Base Layer

Assets/USharpVideo/Examples/Scenes/VideoPlayerExampleScene.unity

Lines changed: 616 additions & 98 deletions
Large diffs are not rendered by default.

Assets/USharpVideo/Examples/Scripts/ExampleVideoPlayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace UdonSharp.Video
1616
{
17-
[AddComponentMenu("Udon Sharp/Video/Example Video Player")]
17+
[AddComponentMenu("Udon Sharp/Video/Examples/Example Video Player")]
1818
public class ExampleVideoPlayer : UdonSharpBehaviour
1919
{
2020
public VRCUrlInputField inputField;

Assets/USharpVideo/Examples/Scripts/PlayURLButton.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace UdonSharp.Video.Examples
1111
/// Plays a specified video URL when OnButtonPress is triggered by a button in this example. See the URLButton prefab for a use of this.
1212
/// </summary>
1313
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
14+
[AddComponentMenu("Udon Sharp/Video/Examples/Play URL Button")]
1415
public class PlayURLButton : UdonSharpBehaviour
1516
{
1617
public USharpVideoPlayer targetVideoPlayer;

Assets/USharpVideo/Examples/Scripts/ReloadButton.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace UdonSharp.Video.Examples
1111
/// You could use SendCustomEvent on the video player itself from the click events on the button, but that's not as easy to document and explain
1212
/// </summary>
1313
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
14+
[AddComponentMenu("Udon Sharp/Video/Examples/Reload Button")]
1415
public class ReloadButton : UdonSharpBehaviour
1516
{
1617
public USharpVideoPlayer targetVideoPlayer;

Assets/USharpVideo/Examples/Scripts/ResyncButton.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace UdonSharp.Video.Examples
88
{
99
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
10+
[AddComponentMenu("Udon Sharp/Video/Examples/Resync Button")]
1011
public class ResyncButton : UdonSharpBehaviour
1112
{
1213
public USharpVideoPlayer videoPlayer;

Assets/USharpVideo/Examples/Scripts/SyncDelayManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace UdonSharp.Video.Examples
1010
/// This can be used for something like karaoke where one person is singing a video and remote players want to hear the voice synced with the video audio.
1111
/// </summary>
1212
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
13+
[AddComponentMenu("Udon Sharp/Video/Examples/Sync Delay Manager")]
1314
public class SyncDelayManager : UdonSharpBehaviour
1415
{
1516
public USharpVideoPlayer videoPlayer;

Assets/USharpVideo/Scripts/Editor/USharpVideoInspector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ public override void OnInspectorGUI()
7979
EditorGUILayout.LabelField("Audio", EditorStyles.boldLabel);
8080

8181
EditorGUI.BeginChangeCheck();
82+
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
8283
EditorGUILayout.PropertyField(defaultVolumeProperty);
84+
EditorGUI.EndDisabledGroup();
8385
EditorGUILayout.PropertyField(audioRangeProperty);
8486

8587
if (EditorGUI.EndChangeCheck())

Assets/USharpVideo/Scripts/UI/SyncModeController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace UdonSharp.Video
99
{
10-
[AddComponentMenu("Udon Sharp/Video/Sync Mode Controller")]
10+
[AddComponentMenu("Udon Sharp/Video/UI/Sync Mode Controller")]
1111
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
1212
public class SyncModeController : UdonSharpBehaviour
1313
{

Assets/USharpVideo/Scripts/UI/UIStyle.cs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11

22
using UnityEngine;
33
using System;
4-
using static UdonSharp.Video.Internal.UIStyleMarkup;
4+
using static UdonSharp.Video.UI.UIStyleMarkup;
55

6-
#if UNITY_EDITOR
7-
using UnityEditor;
8-
#endif
9-
10-
namespace UdonSharp.Video.Internal
6+
namespace UdonSharp.Video.UI
117
{
128
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
139
internal class StyleMarkupLinkAttribute : Attribute
@@ -57,29 +53,4 @@ internal class UIStyle : ScriptableObject
5753
[StyleMarkupLink(StyleClass.TextCaret)]
5854
public Color textCaretColor = Color.white;
5955
}
60-
61-
//#if UNITY_EDITOR
62-
63-
64-
// [CustomEditor(typeof(UIStyle))]
65-
// internal class ColorStyleEditor : Editor
66-
// {
67-
// SerializedProperty[] fieldProperties;
68-
69-
// private void OnEnable()
70-
// {
71-
// FieldInfo[] fields = target.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance);
72-
73-
// fieldProperties = fields.Select(e => serializedObject.FindProperty(e.Name)).Where(e => e != null).ToArray();
74-
// }
75-
76-
// public override void OnInspectorGUI()
77-
// {
78-
// foreach (SerializedProperty property in fieldProperties)
79-
// EditorGUILayout.PropertyField(property);
80-
81-
// serializedObject.ApplyModifiedProperties();
82-
// }
83-
// }
84-
//#endif
8556
}

0 commit comments

Comments
 (0)