Skip to content
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.

Commit

Permalink
GVR SDK for Unity v1.100.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rusmaxham committed Oct 7, 2017
1 parent 65c8b57 commit ca1e250
Show file tree
Hide file tree
Showing 184 changed files with 7,915 additions and 2,719 deletions.
6 changes: 6 additions & 0 deletions Assets/GoogleVR/Demos/Editor/DemoInputManagerEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ void OnEnable () {
public override void OnInspectorGUI() {
serializedObject.Update();

// Add clickable script field, as would have been provided by DrawDefaultInspector()
MonoScript script = MonoScript.FromMonoBehaviour (target as MonoBehaviour);
EditorGUI.BeginDisabledGroup (true);
EditorGUILayout.ObjectField ("Script", script, typeof(MonoScript), false);
EditorGUI.EndDisabledGroup ();

EditorGUILayout.PropertyField(gvrControllerMainProp);
EditorGUILayout.PropertyField(gvrControllerPointerProp);
EditorGUILayout.PropertyField(gvrReticlePointerProp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
// See the License for the specific language governing permissioßns and
// limitations under the License.

// This script only works in Unity 5.6 or newer since older versions of Unity
// don't have IPreprocessBuild and IPostprocessBuild.
#if UNITY_5_6_OR_NEWER && UNITY_ANDROID
// Only invoke custom build processor when building for Android.
#if UNITY_ANDROID
using System;
using UnityEditor;
using UnityEditor.Build;
using UnityEngine;
using UnityEditorInternal.VR;

class MyCustomBuildProcessor : IPreprocessBuild, IPostprocessBuild
class PermissionsDemoBuildProcessor : IPreprocessBuild, IPostprocessBuild
{
private const string SCENE_NAME_PERMISSIONS_DEMO = "PermissionsDemo";
private const string VR_DEVICE_CARDBOARD = "cardboard";
Expand All @@ -34,12 +33,12 @@ public int callbackOrder
get { return 0; }
}

// OnPreprocessBuild() is called rigth before the build process begins. If it
// OnPreprocessBuild() is called right before the build process begins. If it
// detects that the first enabled scene in the build arrays is the PermissionsDemo,
// and Daydream is in the VR SDKs, it will add Cardboard to the VR SDKs. Because
// the PermissionsDemo needs a perm statement in the Manifest while other demos don't.
// Adding Cardboard to VR SDKs will merge in the Manifest-Cardboard which has perm
// statemetn in it.
// statement in it.
public void OnPreprocessBuild(BuildTarget target, string path)
{
m_cardboardAddedFromCode = false;
Expand Down Expand Up @@ -114,7 +113,7 @@ public void OnPostprocessBuild(BuildTarget target, string path)

string[] androidVrSDKs = VREditor.GetVREnabledDevicesOnTargetGroup(BuildTargetGroup.Android);

// The enabled devices are modified somehow, which shoudln't happen. Abort the post build process.
// The enabled devices are modified somehow, which shouldn't happen. Abort the post build process.
if (androidVrSDKs.Length == 0 || androidVrSDKs[androidVrSDKs.Length - 1] != VR_DEVICE_CARDBOARD)
{
return;
Expand All @@ -136,4 +135,4 @@ public void OnPostprocessBuild(BuildTarget target, string path)
m_cardboardAddedFromCode = false;
}
}
#endif // UNITY_5_6_OR_NEWER && UNITY_ANDROID
#endif // UNITY_ANDROID
Loading

0 comments on commit ca1e250

Please sign in to comment.