Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions Assets/InteractionZone.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Assets/InteractionZone/AppearCylinder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AppearCylinder : MonoBehaviour {
public GameObject cylinder;

void OnTriggerStay(Collider other)
{
if (other.gameObject.CompareTag ("Trigger Box"))
{
cylinder.SetActive (true);
}
}

void OnTriggerExit(Collider other)
{
if (other.gameObject.CompareTag ("Trigger Box"))
{
cylinder.SetActive (false);
}
}
}
12 changes: 12 additions & 0 deletions Assets/InteractionZone/AppearCylinder.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/InteractionZone/Triggerbox.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/InteractionZone/Triggerbox.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/InteractionZone/interactiontest.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/InteractionZone/interactiontest.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Pickup.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Pickup.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Prefabs/pickup.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Prefabs/pickup.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Prefabs/starting stats.prefab
Binary file not shown.
9 changes: 9 additions & 0 deletions Assets/Prefabs/starting stats.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/SteamVR.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Assets/SteamVR/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 127 additions & 0 deletions Assets/SteamVR/Editor/SteamVR_Editor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
//=============================================================================

using UnityEngine;
using UnityEditor;
using System.IO;

[CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects]
public class SteamVR_Editor : Editor
{
int bannerHeight = 150;
Texture logo;

SerializedProperty script, wireframe;

string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}

void OnEnable()
{
var resourcePath = GetResourcePath();

logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");

script = serializedObject.FindProperty("m_Script");

wireframe = serializedObject.FindProperty("wireframe");

foreach (SteamVR_Camera target in targets)
target.ForceLast();
}

public override void OnInspectorGUI()
{
serializedObject.Update();

var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);

if (!Application.isPlaying)
{
var expand = false;
var collapse = false;
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
collapse = true;
else
expand = true;
}

if (expand)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Expand"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (!target.isExpanded)
{
target.Expand();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}

if (collapse)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Collapse"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
{
target.Collapse();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
}

EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(wireframe);

serializedObject.ApplyModifiedProperties();
}

public static void ExportPackage()
{
AssetDatabase.ExportPackage(new string[] {
"Assets/SteamVR",
"Assets/Plugins/openvr_api.cs",
"Assets/Plugins/openvr_api.bundle",
"Assets/Plugins/x86/openvr_api.dll",
"Assets/Plugins/x86/steam_api.dll",
"Assets/Plugins/x86/libsteam_api.so",
"Assets/Plugins/x86_64/openvr_api.dll",
"Assets/Plugins/x86_64/steam_api.dll",
"Assets/Plugins/x86_64/libsteam_api.so",
"Assets/Plugins/x86_64/libopenvr_api.so",
}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
EditorApplication.Exit(0);
}
}

9 changes: 9 additions & 0 deletions Assets/SteamVR/Editor/SteamVR_Editor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions Assets/SteamVR/Editor/SteamVR_Preferences.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Preferences pane for how SteamVR plugin behaves.
//
//=============================================================================

using UnityEngine;
using UnityEditor;

public class SteamVR_Preferences
{
/// <summary>
/// Should SteamVR automatically enable VR when opening Unity or pressing play.
/// </summary>
public static bool AutoEnableVR
{
get
{
return EditorPrefs.GetBool("SteamVR_AutoEnableVR", true);
}
set
{
EditorPrefs.SetBool("SteamVR_AutoEnableVR", value);
}
}

[PreferenceItem("SteamVR")]
static void PreferencesGUI()
{
EditorGUILayout.BeginVertical();
EditorGUILayout.Space();

// Automatically Enable VR
{
string title = "Automatically Enable VR";
string tooltip = "Should SteamVR automatically enable VR on launch and play?";
AutoEnableVR = EditorGUILayout.Toggle(new GUIContent(title, tooltip), AutoEnableVR);
string helpMessage = "To enable VR manually:\n";
helpMessage += "- go to Edit -> Project Settings -> Player,\n";
helpMessage += "- tick 'Virtual Reality Supported',\n";
helpMessage += "- make sure OpenVR is in the 'Virtual Reality SDKs' list.";
EditorGUILayout.HelpBox(helpMessage, MessageType.Info);
}

EditorGUILayout.EndVertical();
}
}

12 changes: 12 additions & 0 deletions Assets/SteamVR/Editor/SteamVR_Preferences.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading