Jamie Greunbaum ef9ccfef19 - Added trees outside the stable.
- Added a video player with horse songs preloaded.
- Adjusted post-processing to be less harsh outdoors, and more visible indoors.
2025-05-03 01:57:06 -04:00

51 lines
1.2 KiB
C#

using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonSharp.Video.Examples
{
/// <summary>
/// Plays a specified video URL when OnButtonPress is triggered by a button in this example. See the URLButton prefab for a use of this.
/// </summary>
[UdonBehaviourSyncMode(BehaviourSyncMode.NoVariableSync)]
[AddComponentMenu("Udon Sharp/Video/Examples/Play URL Button")]
public class PlayURLButton : UdonSharpBehaviour
{
public USharpVideoPlayer targetVideoPlayer;
public VRCUrl url = new VRCUrl("");
Button button;
void Start()
{
button = GetComponentInChildren<Button>();
UpdateOwnership();
targetVideoPlayer.RegisterCallbackReceiver(this);
}
public void OnButtonPress()
{
targetVideoPlayer.PlayVideo(url);
}
public void OnUSharpVideoLockChange()
{
UpdateOwnership();
}
public void OnUSharpVideoOwnershipChange()
{
UpdateOwnership();
}
void UpdateOwnership()
{
button.interactable = targetVideoPlayer.CanControlVideoPlayer();
}
}
}