Initialer Upload neues Unity-Projekt
This commit is contained in:
23
Assets/Oculus/VR/Scripts/BuildingBlocks/AssemblyInfo.cs
Normal file
23
Assets/Oculus/VR/Scripts/BuildingBlocks/AssemblyInfo.cs
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
[assembly: InternalsVisibleTo("Meta.XR.BuildingBlocks.Editor")]
|
||||
11
Assets/Oculus/VR/Scripts/BuildingBlocks/AssemblyInfo.cs.meta
Normal file
11
Assets/Oculus/VR/Scripts/BuildingBlocks/AssemblyInfo.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c3be90808049d02438e1636838abb82c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
45
Assets/Oculus/VR/Scripts/BuildingBlocks/BuildingBlock.cs
Normal file
45
Assets/Oculus/VR/Scripts/BuildingBlocks/BuildingBlock.cs
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.XR.BuildingBlocks
|
||||
{
|
||||
[DisallowMultipleComponent]
|
||||
public class BuildingBlock : MonoBehaviour
|
||||
{
|
||||
[SerializeField, OVRReadOnly] internal string blockId;
|
||||
public string BlockId => blockId;
|
||||
|
||||
[SerializeField, HideInInspector] internal string instanceId = Guid.NewGuid().ToString();
|
||||
public string InstanceId => instanceId;
|
||||
|
||||
[SerializeField, OVRReadOnly] internal int version = 1;
|
||||
public int Version => version;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
OVRTelemetry.Start(OVRTelemetryConstants.BB.MarkerId.RunBlock)
|
||||
.AddBlockInfo(this)
|
||||
.Send();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b023183069df224080314a560e6e1ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 6557dba7c7035a3448c0583098600c6c, type: 3}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "Meta.XR.BuildingBlocks",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"Oculus.VR"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0574574baafe9d4aa78d8df4a5e3e5e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Meta.XR.BuildingBlocks
|
||||
{
|
||||
public class PassthroughProjectionSurfaceBuildingBlock : MonoBehaviour
|
||||
{
|
||||
public MeshFilter projectionObject;
|
||||
|
||||
// Start is called before the first frame update
|
||||
private void Start()
|
||||
{
|
||||
var ptLayers = FindObjectsOfType<OVRPassthroughLayer>();
|
||||
var foundLayer = false;
|
||||
|
||||
foreach (var ptLayer in ptLayers)
|
||||
{
|
||||
if (!ptLayer.GetComponent<BuildingBlock>())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
foundLayer = true;
|
||||
ptLayer.AddSurfaceGeometry(projectionObject.gameObject, true);
|
||||
}
|
||||
|
||||
if (foundLayer)
|
||||
{
|
||||
// The MeshRenderer component renders the quad as a blue outline
|
||||
// we only use this when Passthrough isn't visible
|
||||
var quadOutline = projectionObject.GetComponent<MeshRenderer>();
|
||||
quadOutline.enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("A BB with the passthrough overlay layer was not found");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2c153b9a5da6ec24bb71a81fc631f600
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
33
Assets/Oculus/VR/Scripts/BuildingBlocks/Telemetry.cs
Normal file
33
Assets/Oculus/VR/Scripts/BuildingBlocks/Telemetry.cs
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Licensed under the Oculus SDK License Agreement (the "License");
|
||||
* you may not use the Oculus SDK except in compliance with the License,
|
||||
* which is provided at the time of installation or download, or which
|
||||
* otherwise accompanies this software in either electronic or hard copy form.
|
||||
*
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://developer.oculus.com/licenses/oculussdk/
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, the Oculus SDK
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
namespace Meta.XR.BuildingBlocks
|
||||
{
|
||||
internal static class Telemetry
|
||||
{
|
||||
public static OVRTelemetryMarker AddBlockInfo(this OVRTelemetryMarker marker, BuildingBlock block)
|
||||
{
|
||||
return marker.AddAnnotation(OVRTelemetryConstants.BB.AnnotationType.BlockId, block.BlockId)
|
||||
.AddAnnotation(OVRTelemetryConstants.BB.AnnotationType.InstanceId, block.InstanceId)
|
||||
.AddAnnotation(OVRTelemetryConstants.BB.AnnotationType.BlockName, block.gameObject.name)
|
||||
.AddAnnotation(OVRTelemetryConstants.BB.AnnotationType.Version, block.Version.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Oculus/VR/Scripts/BuildingBlocks/Telemetry.cs.meta
Normal file
11
Assets/Oculus/VR/Scripts/BuildingBlocks/Telemetry.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d93bbab64ed50ea45b9bc8df3d334c0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user