Skip to content

Commit

Permalink
v1.8.9
Browse files Browse the repository at this point in the history
Updated/bugfix Quest support
added quest specific error screen
added an initialization script
added Movie Button script
  • Loading branch information
ChildoftheBeast authored Jul 3, 2021
1 parent 4c4349f commit 8ffaafc
Show file tree
Hide file tree
Showing 4 changed files with 231 additions and 68 deletions.
35 changes: 29 additions & 6 deletions Emission.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ namespace UdonVR.Childofthebeast
{
public class Emission : UdonSharpBehaviour
{
#if UNITY_ANDROID
private bool isQuest = true;
#else
private bool isQuest = false;
#endif
public MeshRenderer ScreenMesh;
public int Material_Index;
public bool SharedMerial = false;
Expand All @@ -24,10 +29,12 @@ public class Emission : UdonSharpBehaviour
private float _CurrentEmission = 1;
private bool _IsOn = true;
private int _Frame = 0;
private InputField _FrameSkipFeild;
public InputField FrameSkipFeild;
public Text FramSkipText;

private void Start()
{
if (!isQuest) InitPC();
if (ScreenMesh == null) ScreenMesh = gameObject.GetComponent<MeshRenderer>();
if (SharedMerial)
{
Expand All @@ -45,7 +52,6 @@ private void Start()
if (UpdateRealtimeGI)
{
FrameSkipUI.SetActive(true);
_FrameSkipFeild = FrameSkipUI.GetComponentInChildren<InputField>();
}
}
public void SetHide()
Expand Down Expand Up @@ -130,23 +136,40 @@ private void Update()
public void FrameUp()
{
FrameSkip++;
_FrameSkipFeild.text = FrameSkip.ToString();
UpdateFeild(FrameSkip.ToString());
}

public void FrameDown()
{
if (FrameSkip <= 0) return;
FrameSkip--;
_FrameSkipFeild.text = FrameSkip.ToString();
UpdateFeild(FrameSkip.ToString());
}

public void FrameSet()
{
int _var = 0;
int.TryParse(_FrameSkipFeild.text, out _var);
int.TryParse(FrameSkipFeild.text, out _var);
if (_var <= 0) _var = 0;
FrameSkip = _var;
_FrameSkipFeild.text = FrameSkip.ToString();
UpdateFeild(FrameSkip.ToString());
}

private void UpdateFeild(string _str)
{
if (isQuest)
{
FramSkipText.text = _str;
}
else
{
FrameSkipFeild.text = _str;
}
}

private void InitPC()
{
FrameSkipFeild.interactable = true;
}
}
}
19 changes: 19 additions & 0 deletions InitPlayerScripts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

namespace UdonVR.Takato.VideoPlayer
{
public class InitPlayerScripts : UdonSharpBehaviour
{
public UdonSyncVideoPlayer Player;
public LoopToggle LoopToggle;
void Start()
{
Player.Init();
LoopToggle.Init();
}
}
}
21 changes: 21 additions & 0 deletions PlayMovie.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

using UdonSharp;
using UnityEngine;
using VRC.SDKBase;
using VRC.Udon;

namespace UdonVR.Takato.VideoPlayer
{
public class PlayMovie : UdonSharpBehaviour
{
public UdonSyncVideoPlayer Player;
public VRCUrl URL;

public override void Interact()
{
Player.TakeOwner();
Player.ChangeVideoUrlVRC(URL);
}
}

}
Loading

0 comments on commit 8ffaafc

Please sign in to comment.