-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PanelUI.cs
96 lines (85 loc) · 2.53 KB
/
PanelUI.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
using System;
using TMPro;
using UdonSharp;
using UnityEngine;
using UnityEngine.UI;
using VRC.SDK3.Components;
using VRC.SDKBase;
using VRC.Udon;
namespace UdonVR.Takato.VideoPlayer
{
/// <summary>
///
/// </summary>
public class PanelUI : UdonSharpBehaviour
{
public UdonSyncVideoPlayer UdonSyncVideoPlayer;
public GameObject autoResyncFilled;
public TextMeshProUGUI resyncText;
public InputField autoResyncRateInput;
public Text ownerText;
public Slider videoTimeBar;
public Text videoTimeBarText;
public void AutoResyncToggle(bool value)
{
if (Utilities.IsValid(autoResyncFilled))
{
autoResyncFilled.SetActive(value);
}
}
public void AutoResyncSet()
{
if (Utilities.IsValid(autoResyncRateInput))
{
if (!string.IsNullOrEmpty(autoResyncRateInput.text.Trim()))
return;
int temp;
int.TryParse(autoResyncRateInput.text, out temp);
UdonSyncVideoPlayer.AutoResyncSet(temp);
autoResyncRateInput.text = string.Empty;
}
}
public void AutoResyncRateInput(int value)
{
if (Utilities.IsValid(autoResyncRateInput))
{
((Text)autoResyncRateInput.placeholder).text= value.ToString();
}
}
public void SetOwnerText(string displayName)
{
if (Utilities.IsValid(ownerText))
{
ownerText.text = displayName;
}
}
public void SetVideoTimeBarValue(int value)
{
if (Utilities.IsValid(videoTimeBar))
{
videoTimeBar.value = value;
}
}
public void SetVideoTimeBarMaxValue(float value)
{
if (Utilities.IsValid(videoTimeBar))
{
videoTimeBar.maxValue = value;
}
}
public void VideoTimeBarInteractable(bool value)
{
if (Utilities.IsValid(videoTimeBar))
{
videoTimeBar.interactable = value;
}
}
public void SetResyncText(string value)
{
if (Utilities.IsValid(resyncText))
{
resyncText.text = value;
}
}
}
}