Skip to content

Commit

Permalink
Fixes for ED
Browse files Browse the repository at this point in the history
Other games too probably. Hopefully this doesn't break anything.
  • Loading branch information
Hotrian committed Jul 23, 2016
1 parent 4a3a598 commit 7425dbc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Binary file modified Assets/HOTK/Example Content/HOTK_TwitchDemoScene.unity
Binary file not shown.
17 changes: 17 additions & 0 deletions Assets/HOTK/Twitch/TwitchChatTester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using System.Linq;
using UnityEngine.UI;
using Valve.VR;
using Debug = UnityEngine.Debug;

[RequireComponent(typeof(TwitchIRC), typeof(TextMesh))]
Expand Down Expand Up @@ -77,6 +78,7 @@ public void Awake()
public void Start()
{
ClearViewerCountAndChannelName("Disconnected");
StartCoroutine("SyncWithSteamVR");
}

public void ToggleConnect()
Expand Down Expand Up @@ -111,9 +113,11 @@ public void ToggleConnect()
knownFollowers.Clear();
StopCoroutine("UpdateViews");
StopCoroutine("UpdateFollowers");
StopCoroutine("SyncWithSteamVR");
gettingInitialFollowers = true;
StartCoroutine("UpdateViews");
StartCoroutine("UpdateFollowers");
StartCoroutine("SyncWithSteamVR");
}
else AddSystemNotice("Unable to Connect: Enter a Valid Channel Name!", TwitchIRC.NoticeColor.Red);
}
Expand All @@ -139,6 +143,19 @@ public void ToggleConnect()
}
}

IEnumerator SyncWithSteamVR()
{
while (Application.isPlaying)
{
var compositor = OpenVR.Compositor;
if (compositor != null)
{
var trackingSpace = compositor.GetTrackingSpace();
SteamVR_Render.instance.trackingSpace = trackingSpace;
}
yield return new WaitForSeconds(10f);
}
}

private Dictionary<uint, FollowsData> knownFollowers = new Dictionary<uint, FollowsData>();
private bool gettingInitialFollowers;
Expand Down
3 changes: 2 additions & 1 deletion Assets/SteamVR/Scripts/SteamVR_Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ private IEnumerator RenderLoop()
if (!compositor.CanRenderScene())
continue;

compositor.SetTrackingSpace(trackingSpace);
trackingSpace = compositor.GetTrackingSpace();
compositor.SetTrackingSpace(trackingSpace);

#if (UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (cameras.Length == 0) continue;
Expand Down

0 comments on commit 7425dbc

Please sign in to comment.