Skip to content

Commit 28923dc

Browse files
committed
Version 2.0 RC3 - Namespaced, examples, paint job, better init, docs
Changes for v2.0rc3: * Added some pdf documentation for the new plugin and input system * Added code documentation to most public functions in the input system * Removed SteamVR_Camera from prefabs as this is no longer necessary * Added simple rc car example ported from Knuckles Tech Demo * Added simple platformer example * Switched hover highlights to highlight the object being interacted with instead of the controller. Can be reenabled in the player prefab. * Fixed some upgrading issues for Unity 2018 * Added glcore to a few of the shaders to make them opengl compatible * Fixed a code generation issue that was generating static members instead of instance members, making actions inside sets unavailable. * Added scrollview to LiveWindow * Fixed some issues with action sets * Added DefaultActionSet attribute to specify a default action set to be assigned to fields/properties on input generation * Updated some scriptable object fields to not serialize things unintentionally * Made initialization a little more streamlined. * Added an event you can subscribe to for when initialization is completed (SteamVR_Events.Initialized(bool)). The bool indicates success * Improved editor UI for action / action set assignment * Made the example button do something on press Changes for v2.0rc2: * Added built in support for delayed loading of SteamVR. You can now call SteamVR.Initialize() and pass a boolean to force set unity to OpenVR mode. * Added a new Simple Sample scene in the root to do super basic testing. * Moved SteamVR Input updating to SteamVR_Behaviour which also handles the SteamVR_Render component. This will be added to scenes at runtime. * Added ability to explicitly show or hide controller model in the interaction system * Gave the interaction system scene a new paint job * Auto scaling the teleporter beam to the player size * Added a new quickstart pdf * Fixed issue for Unity 5.6 not showing controllers * Fixed issue for 2018.2 not opening the input window properly * Minor performance increases * Updated initialization process to support having XR set to none or Oculus initially. * Moved some of example jsons files into a more reasonable directory. Changes for v2.0rc1: * Namespacing all SteamVR scripts. This will be a breaking change for most projects but this is a major revision. * Renamed most of the input classes to have a more reasonable length. Generally removed _Input_ as it's redundant in most places * Fixed some issues with newer versions of Unity throwing errors during action generation * Fixed some issues with scenes not opening properly during generation on newer versions of Unity * Removing SteamVR_Settings from plugin, it should be auto generated so new versions of the plugin don't overwrite it * Fixed some performance issues surrounding using the legacy input system at the same time as the new input system. This is not a supported scenario. * Minor performance increases around render model loading. * Removed some legacy system scripts * Fixed the button hint system * Consolidated the skeleton options
1 parent ad025ba commit 28923dc

File tree

524 files changed

+108969
-87822
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

524 files changed

+108969
-87822
lines changed

Assets/SteamVR/Editor/SteamVR_Editor.cs

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -7,121 +7,121 @@
77
using UnityEngine;
88
using UnityEditor;
99
using System.IO;
10+
using Valve.VR;
1011

1112
[CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects]
1213
public class SteamVR_Editor : Editor
1314
{
14-
int bannerHeight = 150;
15-
Texture logo;
16-
17-
SerializedProperty script, wireframe;
18-
19-
string GetResourcePath()
20-
{
21-
var ms = MonoScript.FromScriptableObject(this);
22-
var path = AssetDatabase.GetAssetPath(ms);
23-
path = Path.GetDirectoryName(path);
24-
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
25-
}
26-
27-
void OnEnable()
28-
{
29-
var resourcePath = GetResourcePath();
30-
31-
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
32-
33-
script = serializedObject.FindProperty("m_Script");
34-
35-
wireframe = serializedObject.FindProperty("wireframe");
36-
37-
foreach (SteamVR_Camera target in targets)
38-
target.ForceLast();
39-
}
40-
41-
public override void OnInspectorGUI()
42-
{
43-
serializedObject.Update();
44-
45-
var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
46-
if (logo)
47-
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
48-
49-
if (!Application.isPlaying)
50-
{
51-
var expand = false;
52-
var collapse = false;
53-
foreach (SteamVR_Camera target in targets)
54-
{
55-
if (AssetDatabase.Contains(target))
56-
continue;
57-
if (target.isExpanded)
58-
collapse = true;
59-
else
60-
expand = true;
61-
}
62-
63-
if (expand)
64-
{
65-
GUILayout.BeginHorizontal();
66-
if (GUILayout.Button("Expand"))
67-
{
68-
foreach (SteamVR_Camera target in targets)
69-
{
70-
if (AssetDatabase.Contains(target))
71-
continue;
72-
if (!target.isExpanded)
73-
{
74-
target.Expand();
75-
EditorUtility.SetDirty(target);
76-
}
77-
}
78-
}
79-
GUILayout.Space(18);
80-
GUILayout.EndHorizontal();
81-
}
82-
83-
if (collapse)
84-
{
85-
GUILayout.BeginHorizontal();
86-
if (GUILayout.Button("Collapse"))
87-
{
88-
foreach (SteamVR_Camera target in targets)
89-
{
90-
if (AssetDatabase.Contains(target))
91-
continue;
92-
if (target.isExpanded)
93-
{
94-
target.Collapse();
95-
EditorUtility.SetDirty(target);
96-
}
97-
}
98-
}
99-
GUILayout.Space(18);
100-
GUILayout.EndHorizontal();
101-
}
102-
}
103-
104-
EditorGUILayout.PropertyField(script);
105-
EditorGUILayout.PropertyField(wireframe);
106-
107-
serializedObject.ApplyModifiedProperties();
108-
}
109-
110-
public static void ExportPackage()
111-
{
112-
AssetDatabase.ExportPackage(new string[] {
113-
"Assets/SteamVR",
114-
"Assets/Plugins/openvr_api.cs",
115-
"Assets/Plugins/openvr_api.bundle",
116-
"Assets/Plugins/x86/openvr_api.dll",
117-
"Assets/Plugins/x86/steam_api.dll",
118-
"Assets/Plugins/x86/libsteam_api.so",
119-
"Assets/Plugins/x86_64/openvr_api.dll",
120-
"Assets/Plugins/x86_64/steam_api.dll",
121-
"Assets/Plugins/x86_64/libsteam_api.so",
122-
"Assets/Plugins/x86_64/libopenvr_api.so",
123-
}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
124-
EditorApplication.Exit(0);
125-
}
126-
}
127-
15+
int bannerHeight = 150;
16+
Texture logo;
17+
18+
SerializedProperty script, wireframe;
19+
20+
string GetResourcePath()
21+
{
22+
var ms = MonoScript.FromScriptableObject(this);
23+
var path = AssetDatabase.GetAssetPath(ms);
24+
path = Path.GetDirectoryName(path);
25+
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
26+
}
27+
28+
void OnEnable()
29+
{
30+
var resourcePath = GetResourcePath();
31+
32+
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
33+
34+
script = serializedObject.FindProperty("m_Script");
35+
36+
wireframe = serializedObject.FindProperty("wireframe");
37+
38+
foreach (SteamVR_Camera target in targets)
39+
target.ForceLast();
40+
}
41+
42+
public override void OnInspectorGUI()
43+
{
44+
serializedObject.Update();
45+
46+
var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
47+
if (logo)
48+
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
49+
50+
if (!Application.isPlaying)
51+
{
52+
var expand = false;
53+
var collapse = false;
54+
foreach (SteamVR_Camera target in targets)
55+
{
56+
if (AssetDatabase.Contains(target))
57+
continue;
58+
if (target.isExpanded)
59+
collapse = true;
60+
else
61+
expand = true;
62+
}
63+
64+
if (expand)
65+
{
66+
GUILayout.BeginHorizontal();
67+
if (GUILayout.Button("Expand"))
68+
{
69+
foreach (SteamVR_Camera target in targets)
70+
{
71+
if (AssetDatabase.Contains(target))
72+
continue;
73+
if (!target.isExpanded)
74+
{
75+
target.Expand();
76+
EditorUtility.SetDirty(target);
77+
}
78+
}
79+
}
80+
GUILayout.Space(18);
81+
GUILayout.EndHorizontal();
82+
}
83+
84+
if (collapse)
85+
{
86+
GUILayout.BeginHorizontal();
87+
if (GUILayout.Button("Collapse"))
88+
{
89+
foreach (SteamVR_Camera target in targets)
90+
{
91+
if (AssetDatabase.Contains(target))
92+
continue;
93+
if (target.isExpanded)
94+
{
95+
target.Collapse();
96+
EditorUtility.SetDirty(target);
97+
}
98+
}
99+
}
100+
GUILayout.Space(18);
101+
GUILayout.EndHorizontal();
102+
}
103+
}
104+
105+
EditorGUILayout.PropertyField(script);
106+
EditorGUILayout.PropertyField(wireframe);
107+
108+
serializedObject.ApplyModifiedProperties();
109+
}
110+
111+
public static void ExportPackage()
112+
{
113+
AssetDatabase.ExportPackage(new string[] {
114+
"Assets/SteamVR",
115+
"Assets/Plugins/openvr_api.cs",
116+
"Assets/Plugins/openvr_api.bundle",
117+
"Assets/Plugins/x86/openvr_api.dll",
118+
"Assets/Plugins/x86/steam_api.dll",
119+
"Assets/Plugins/x86/libsteam_api.so",
120+
"Assets/Plugins/x86_64/openvr_api.dll",
121+
"Assets/Plugins/x86_64/steam_api.dll",
122+
"Assets/Plugins/x86_64/libsteam_api.so",
123+
"Assets/Plugins/x86_64/libopenvr_api.so",
124+
}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
125+
EditorApplication.Exit(0);
126+
}
127+
}

Assets/SteamVR/Editor/SteamVR_Preferences.cs

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,44 @@
77
using UnityEngine;
88
using UnityEditor;
99

10-
public class SteamVR_Preferences
10+
namespace Valve.VR
1111
{
12-
/// <summary>
13-
/// Should SteamVR automatically enable VR when opening Unity or pressing play.
14-
/// </summary>
15-
public static bool AutoEnableVR
16-
{
17-
get
18-
{
19-
return EditorPrefs.GetBool("SteamVR_AutoEnableVR", true);
20-
}
21-
set
22-
{
23-
EditorPrefs.SetBool("SteamVR_AutoEnableVR", value);
24-
}
25-
}
12+
public class SteamVR_Preferences
13+
{
14+
/// <summary>
15+
/// Should SteamVR automatically enable VR when opening Unity or pressing play.
16+
/// </summary>
17+
public static bool AutoEnableVR
18+
{
19+
get
20+
{
21+
return EditorPrefs.GetBool("SteamVR_AutoEnableVR", true);
22+
}
23+
set
24+
{
25+
EditorPrefs.SetBool("SteamVR_AutoEnableVR", value);
26+
}
27+
}
2628

27-
[PreferenceItem("SteamVR")]
28-
static void PreferencesGUI()
29-
{
30-
EditorGUILayout.BeginVertical();
31-
EditorGUILayout.Space();
29+
[PreferenceItem("SteamVR")]
30+
static void PreferencesGUI()
31+
{
32+
EditorGUILayout.BeginVertical();
33+
EditorGUILayout.Space();
3234

33-
// Automatically Enable VR
34-
{
35-
string title = "Automatically Enable VR";
36-
string tooltip = "Should SteamVR automatically enable VR on launch and play?";
37-
AutoEnableVR = EditorGUILayout.Toggle(new GUIContent(title, tooltip), AutoEnableVR);
38-
string helpMessage = "To enable VR manually:\n";
39-
helpMessage += "- go to Edit -> Project Settings -> Player,\n";
40-
helpMessage += "- tick 'Virtual Reality Supported',\n";
41-
helpMessage += "- make sure OpenVR is in the 'Virtual Reality SDKs' list.";
42-
EditorGUILayout.HelpBox(helpMessage, MessageType.Info);
43-
}
44-
45-
EditorGUILayout.EndVertical();
46-
}
47-
}
35+
// Automatically Enable VR
36+
{
37+
string title = "Automatically Enable VR";
38+
string tooltip = "Should SteamVR automatically enable VR on launch and play?";
39+
AutoEnableVR = EditorGUILayout.Toggle(new GUIContent(title, tooltip), AutoEnableVR);
40+
string helpMessage = "To enable VR manually:\n";
41+
helpMessage += "- go to Edit -> Project Settings -> Player,\n";
42+
helpMessage += "- tick 'Virtual Reality Supported',\n";
43+
helpMessage += "- make sure OpenVR is in the 'Virtual Reality SDKs' list.";
44+
EditorGUILayout.HelpBox(helpMessage, MessageType.Info);
45+
}
4846

47+
EditorGUILayout.EndVertical();
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)