Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
FocusVRGames's avatar
FocusVRGames
Adventurer
8 years ago

Unity Stats into OVRDebugInfo (Instructions included)

Quickly hacked this together and thought it might be worth sharing as I use the unity stats window and often have to come out of the headset to see the stats and I'm sure I'm not alone with that

So I brought some of those stats into the OVRDebugInfo, you press "space" and then "u" to activate the stats

Open
OVR\Scripts\Utils\OVRDebugInfo

Insert
using UnityEditor;
Insert a couple of variables I put them under bool showVRVars = false;
bool showUnityStats = false;
float nextUpdate;
Insert the below Inside void update()
if (Input.GetKeyDown(KeyCode.U) && showVRVars)
{showUnityStats ^= true;}
Change the Line UpdateVariable(); to
if (showUnityStats)
{ UpdateUnityStats();}
else
{UpdateVariable();}
Insert the below function anywhere you like
void UpdateUnityStats()
{
UpdateFPS();
strIPD = System.String.Format("SetPass: {0:F0} Shadow Casters: {1:F0}", UnityStats.setPassCalls, UnityStats.shadowCasters);
strFOV = System.String.Format("Batches: {0:F0}", UnityStats.batches);
strHeight = System.String.Format("Tris: {0:F1}k Verts: {1:F1}k", UnityStats.triangles / 1000 , UnityStats.vertices / 1000);
if (Time.time > nextUpdate)
{
nextUpdate = Time.time + 0.25f;
strDepth = System.String.Format("Render: {0:F1}ms", UnityStats.renderTime * 1000);
}
strResolutionEyeTexture = System.String.Format("Visible Skinned: {0} Animations: {1}", UnityStats.visibleSkinnedMeshes, UnityStats.visibleAnimations);
}

Issues
My shadow Casters always shows 0 not sure why
Couldn't access CPU 

Replies have been turned off for this discussion