Basic Unity scripts for Rift demos
I'm guessing everyone developing with Unity eventually starts putting together useful scripts to add to their library for re-use and to speed up prototyping. I'm still learning Unity, but I've got a few scripts I'd like to share. Perhaps others could do the same?
I'll start with a pretty basic one called "Rift Demo Basics" that comes in the form of a tiny prefab that:
Download: RiftDemoBasics.unitypackage
I noticed several people relying on video capture software like Fraps to show the framerate of a demo, and others have lamented the lack of ability to turn vsync on/off in a demo (by default they are on in Unity demos with Rift integration). And of course, many demos don't hide their immersion-breaking mouse cursor, which for me personally is a pain to move it out of the way so that I can't see it, and at the same time try not to move it to the edge of the screen which does things in Windows 8.
The Unity package at the link above comes with a "Root" prefab which you can just drag into your scene hierarchy and it's set up to hide your mouse, turn vsync off, and show a framerate indicator in the upper right (can't be seen when wearing Rift).
Hope this helps someone!
I'll start with a pretty basic one called "Rift Demo Basics" that comes in the form of a tiny prefab that:
- Lets you show/hide a frame-rate indicator (Configurable),
- Lets you toggle Unity vsync (Configurable),
- Hides your mouse cursor,
- Makes it so that hitting Escape will quit (Configurable).
Download: RiftDemoBasics.unitypackage
I noticed several people relying on video capture software like Fraps to show the framerate of a demo, and others have lamented the lack of ability to turn vsync on/off in a demo (by default they are on in Unity demos with Rift integration). And of course, many demos don't hide their immersion-breaking mouse cursor, which for me personally is a pain to move it out of the way so that I can't see it, and at the same time try not to move it to the edge of the screen which does things in Windows 8.
The Unity package at the link above comes with a "Root" prefab which you can just drag into your scene hierarchy and it's set up to hide your mouse, turn vsync off, and show a framerate indicator in the upper right (can't be seen when wearing Rift).
Hope this helps someone!
