Initialer Upload neues Unity-Projekt

This commit is contained in:
Daniel Ocks
2025-07-21 09:11:14 +02:00
commit eeca72985b
14558 changed files with 1508140 additions and 0 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac56a7dcf53b19342a0358db0b627e99
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,84 @@
/*
* 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 Oculus.Interaction.Input;
using UnityEditor;
namespace Oculus.Interaction.Editor
{
[InitializeOnLoad]
public static class OVRAutoWiring
{
static OVRAutoWiring()
{
AutoWiring.Register(
typeof(OVRCameraRigRef),
new[] {
new ComponentWiringStrategyConfig("_ovrCameraRig", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
})
}
);
AutoWiring.Register(
typeof(FromOVRHandDataSource),
new[] {
new ComponentWiringStrategyConfig("_cameraRigRef", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
}),
new ComponentWiringStrategyConfig("_trackingToWorldTransformer", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
})
}
);
AutoWiring.Register(
typeof(FromOVRControllerHandDataSource),
new[] {
new ComponentWiringStrategyConfig("_cameraRigRef", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
}),
new ComponentWiringStrategyConfig("_trackingToWorldTransformer", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
})
}
);
AutoWiring.Register(
typeof(FromOVRControllerDataSource),
new[] {
new ComponentWiringStrategyConfig("_cameraRigRef", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
}),
new ComponentWiringStrategyConfig("_trackingToWorldTransformer", new FieldWiringStrategy[]
{
FieldWiringStrategies.WireFieldToAncestors
})
}
);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3101156b92d612946bc5cff636ced1ae
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2e98db9701a16b24383aeb20f437ca6c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,46 @@
/*
* 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 Oculus.Interaction.Input;
using System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
using Meta.XR.BuildingBlocks;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
internal static class BlocksUtils
{
public static void UpdateForAutoWiring(GameObject gameObject)
{
UnityObjectAddedBroadcaster.HandleObjectWasAdded(gameObject);
}
public static IEnumerable<Hand> GetHands(string handsBlockId)
{
var handsBlock = Meta.XR.BuildingBlocks.Editor.Utils.GetBlock(handsBlockId);
var handActiveStates = handsBlock.GetComponentsInChildren<HandActiveState>();
foreach (var handActiveState in handActiveStates)
{
yield return handActiveState.GetComponent<Hand>();
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d5cf65266d128e84c98ad936c833e4be
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2caec562909bded489e64f07d771c6f8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2f6825e0f0ce8c0439d0ec1b73008bff
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f0194bc01bdddda47986268559bcdd7b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 44ed1c64fbd105143bff979a6c52c4d6
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5d4a9031703136346be170546fc1d641
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,51 @@
/*
* 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 System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRInteractionHandTrackingBlockData : BlockData
{
public string _interactionBlockId;
protected override List<GameObject> InstallRoutine()
{
var interactionBlockData = Meta.XR.BuildingBlocks.Editor.Utils.GetBlockData(_interactionBlockId);
var interactionBlock = interactionBlockData.GetBlock();
if (interactionBlock == null)
{
throw new InvalidOperationException(
$"Cannot install block '{this.name}' : Cannot find block {interactionBlockData.name} in the scene.");
}
var hands = Instantiate(Prefab, Vector3.zero, Quaternion.identity);
hands.SetActive(true);
hands.name = $"[BB] {BlockName}";
hands.transform.parent = interactionBlock.transform;
BlocksUtils.UpdateForAutoWiring(hands);
return new List<GameObject>() { hands };
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6c4826b5532d66e4db4bdf87d3e73a7d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5cbc063887e35e14689c5d97229735ac
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96924026786b04f6eafd366c51e7040a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 842e5b7503dbf496db332563c60720df
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0f7473c587d9a4d02888511bf051527d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2c518431c9383e44b80394a414ec9a7f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5cff07deb8a11467d99f87d7fc969bdd
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 09afcf33928494372befbc553eb0fc43
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7aec9913f7f564a05883130bcdaf2347
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a39f14d93fa584432b8f4d312acb98c4
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e0b02790818e1456abc62b788328b2a3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 776fcad9cd9881746a5d25ac6728e9f1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: a52e4695e8816e7469e599e85dfae681
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 552e268e6438dd1498f5cd04fa8f27e7
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 53aeaeadc605a914a90f9b107d531936
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b43b26e9e16b544f1a50f7b195d3d48b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0836d00943c564942bece6d380b91ded
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ad47a29653b2662408ec5035f82259c0
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eee067954a0ba4a46a4cbc17f6b0260a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7652d8eea2e03a44d9bf9fa63eed745b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 69f0bbc91a7f97e46a55b2a512b5cf22
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,50 @@
/*
* 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 System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRInteractionBlockData : BlockData
{
public string _cameraRigBlockId;
protected override List<GameObject> InstallRoutine()
{
var cameraRigBlockData = Meta.XR.BuildingBlocks.Editor.Utils.GetBlockData(_cameraRigBlockId);
var cameraRigBlock = cameraRigBlockData.GetBlock();
if (cameraRigBlock == null)
{
throw new InvalidOperationException(
$"Cannot install block '{this.name}' : Cannot find block with type {cameraRigBlock.name} in the scene.");
}
var interaction = Instantiate(Prefab, cameraRigBlock.transform, true);
interaction.SetActive(true);
interaction.name = $"[BB] {BlockName}";
BlocksUtils.UpdateForAutoWiring(interaction);
return new List<GameObject>() { interaction };
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 94769140f5c4f1f489bf7c85fb68acba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7096cfc902f0f42219fb4689cec473b7
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: eb245aa47bf2a0142b534b975dbfa144
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e2df80a30bbc4ce48689606b6842175
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8eb438ab53a734845b94aeea3ac72b45
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6bb165ea6782545fd8deb1d8000cc383
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1fd3335a1733743599c5a4eb5a7c2bcf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cd2af620b985a894881abfc004e150ec
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5fc002002ecb74800b33f4b96a147701
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 62a3c5a0973fc4f48a1039ab80b76232
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ab143fb33d1c042989fb5b744cd67a2e
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9f2b7780078e541b0992d143b95a1514
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c3bb90ba286484c0e957cba7c9199c23
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,56 @@
/*
* 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 Oculus.Interaction.HandGrab;
using Oculus.Interaction.Input;
using Oculus.Interaction.Throw;
using System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRHandPhysicsBlockData : BlockData
{
public string _handsBlockId;
protected override List<GameObject> InstallRoutine()
{
var handPhysicsBlocks = new List<GameObject>();
foreach (var hand in BlocksUtils.GetHands(_handsBlockId))
{
var handPhysicsBlock = InstantiateHandPhysicsBlock(hand);
var grabInteractor = hand.GetComponentInChildren<HandGrabInteractor>();
grabInteractor.InjectOptionalVelocityCalculator(handPhysicsBlock.GetComponent<StandardVelocityCalculator>());
handPhysicsBlocks.Add(handPhysicsBlock);
}
return handPhysicsBlocks;
}
private GameObject InstantiateHandPhysicsBlock(Hand hand)
{
var handPhysicsBlock = Instantiate(Prefab, hand.transform, false);
handPhysicsBlock.SetActive(true);
handPhysicsBlock.name = $"[BB] {hand.Handedness} Hand Physics";
handPhysicsBlock.GetComponent<HandPoseInputDevice>().InjectHand(hand);
BlocksUtils.UpdateForAutoWiring(handPhysicsBlock);
return handPhysicsBlock;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 19a09f7256be84eb8ab26345b8184b29
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,56 @@
/*
* 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 Oculus.Interaction.Input;
using System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRHandPokeLimiterBlockData : BlockData
{
public string _handsBlockId;
protected override List<GameObject> InstallRoutine()
{
var pokeLimiters = new List<GameObject>();
foreach (var hand in BlocksUtils.GetHands(_handsBlockId))
{
var syntheticHand = hand.GetComponentInChildren<SyntheticHand>();
var handPokeInteractor = hand.GetComponentInChildren<PokeInteractor>();
var handPokeLimiterVisual = hand.GetComponentInChildren<HandPokeLimiterVisual>(true);
handPokeLimiterVisual.gameObject.SetActive(true);
handPokeLimiterVisual.InjectAllHandPokeLimiterVisual(hand, handPokeInteractor, syntheticHand);
var syntheticHandVisual = syntheticHand.GetComponentInChildren<HandVisual>();
var handRenderer = syntheticHand.GetComponentInChildren<SkinnedMeshRenderer>();
var materialEditor =
syntheticHand.GetComponentInChildren<MaterialPropertyBlockEditor>();
var overshootGlow = hand.GetComponentInChildren<HandPokeOvershootGlow>(true);
overshootGlow.gameObject.SetActive(true);
overshootGlow.InjectAllHandPokeOvershootGlow(hand, handPokeInteractor, syntheticHandVisual, handRenderer, materialEditor);
pokeLimiters.Add(handPokeLimiterVisual.gameObject);
}
return pokeLimiters;
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: db7ccd9452dd4d59901d858485bc0bf0
timeCreated: 1688553516

View File

@ -0,0 +1,54 @@
/*
* 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 Oculus.Interaction.Input;
using System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRInteractorBlockData : BlockData
{
public string _handsBlockId;
public string _interactorName;
protected override List<GameObject> InstallRoutine()
{
var interactors = new List<GameObject>();
foreach (var hand in BlocksUtils.GetHands(_handsBlockId))
{
var interactor = InstantiateInteractor(hand);
interactors.Add(interactor);
}
return interactors;
}
private GameObject InstantiateInteractor(Hand hand)
{
var interactor = Instantiate(Prefab, hand.transform, false);
interactor.SetActive(true);
interactor.name = $"[BB] {hand.Handedness} {_interactorName}";
BlocksUtils.UpdateForAutoWiring(interactor);
return interactor;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a430ea2bca400b540a4897c70ffeb696
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a154542712a81894face9ac2847c64d4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e88f5cfa5b45c0f4ea71fe36773d52a2
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 81b0c6f02d961984eb074b9834c049ae
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 392af43851d822242be5b1ae72b35b46
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37d7bc76f4a1d9d4ca630b3a36e14649
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,75 @@
/*
* 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 Oculus.Interaction.Input;
using System.Collections.Generic;
using UnityEngine;
using Meta.XR.BuildingBlocks.Editor;
namespace Oculus.Interaction.Editor.BuildingBlocks
{
public class OVRSyntheticHandsBlockData : BlockData
{
public string _handsBlockId;
public string _uOIAssetsHandsBlockId;
public GameObject _leftHand;
public GameObject _rightHand;
protected override List<GameObject> InstallRoutine()
{
var syntheticHands = new List<GameObject>();
foreach (var hand in BlocksUtils.GetHands(_handsBlockId))
{
var syntheticHand = InstantiateHand(hand);
syntheticHands.Add(syntheticHand);
}
DisableUOIAssetsHandVisual();
return syntheticHands;
}
private GameObject InstantiateHand(Hand hand)
{
var handedness = hand.Handedness;
var prefab = handedness == Handedness.Left ? _leftHand : _rightHand;
var syntheticHand = Instantiate(prefab, hand.transform, false);
syntheticHand.GetComponent<SyntheticHand>().InjectModifyDataFromSource(hand);
syntheticHand.SetActive(true);
syntheticHand.name = $"[BB] Synthetic {handedness} Hand";
BlocksUtils.UpdateForAutoWiring(syntheticHand);
return syntheticHand;
}
private void DisableUOIAssetsHandVisual()
{
var handsBlocks = Meta.XR.BuildingBlocks.Editor.Utils.GetBlocks(_uOIAssetsHandsBlockId);
foreach (var hand in handsBlocks)
{
var skeletonRenderer = hand.GetComponent<OVRSkeletonRenderer>();
var meshRenderer = hand.GetComponent<OVRMeshRenderer>();
var skinnedMeshRenderer = hand.GetComponent<SkinnedMeshRenderer>();
if (skeletonRenderer && skeletonRenderer.enabled) skeletonRenderer.enabled = false;
if (meshRenderer && meshRenderer.enabled) meshRenderer.enabled = false;
if (skinnedMeshRenderer && skinnedMeshRenderer.enabled) skinnedMeshRenderer.enabled = false;
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3fb198b2fc4bbcb4999ac10ef4f0ad3b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1e4a3f91312cbb042a301e514935092f
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: abc06eb0aada56e4f98fee84f3377b53
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,135 @@
fileFormatVersion: 2
guid: 876b2885201ff5e46876cfe9ea588452
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 1024
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
{
"name": "Oculus.Interaction.OVR.Editor",
"rootNamespace": "",
"references": [
"GUID:2a230cb87a1d3ba4a98bdc0ddae76e6c",
"GUID:48af58ae5328ff048acacd924604a804",
"GUID:7040c93f6035f5749888e6fdf5ef28f8",
"GUID:f64c9ebcd7899c3448a08dc9f9ddbe30",
"GUID:d2761a0af0f567748a72629d4bb18a26",
"GUID:93bda9a2bc9dddc43930634fa65d6e42",
"GUID:d0574574baafe9d4aa78d8df4a5e3e5e"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": true,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ac6f6d26602ccd34383cd68b90e9941b
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 450015b3adfc77143b5481c3325efd0b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,165 @@
/*
* 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 Oculus.Interaction.Editor;
using System;
using UnityEngine;
using UnityEditor;
using props = Oculus.Interaction.UnityCanvas.OVRCanvasMeshRenderer.Properties;
using baseProps = Oculus.Interaction.UnityCanvas.CanvasMeshRenderer.Properties;
using rtprops = Oculus.Interaction.UnityCanvas.CanvasRenderTexture.Properties;
namespace Oculus.Interaction.UnityCanvas.Editor
{
[CustomEditor(typeof(OVRCanvasMeshRenderer))]
public class OVRCanvasMeshRendererEditor : UnityEditor.Editor
{
private EditorBase _editorDrawer;
private const string DeferredSection = "Deferred";
public new OVRCanvasMeshRenderer target
{
get
{
return base.target as OVRCanvasMeshRenderer;
}
}
protected virtual void OnEnable()
{
_editorDrawer = new EditorBase(serializedObject);
_editorDrawer.AddToSection(DeferredSection, baseProps.UseAlphaToMask, baseProps.AlphaCutoutThreshold);
var renderingMode = serializedObject.FindProperty(baseProps.RenderingMode);
bool CheckIsOVR()
{
return renderingMode.intValue == (int)OVRRenderingMode.Underlay ||
renderingMode.intValue == (int)OVRRenderingMode.Overlay;
}
_editorDrawer.Draw(props.RuntimeOffset, (offsetProp) =>
{
if (CheckIsOVR())
{
EditorGUILayout.PropertyField(offsetProp);
}
});
_editorDrawer.Draw(baseProps.RenderingMode, props.CanvasMesh, (modeProp, meshProp) =>
{
EditorGUILayout.PropertyField(meshProp);
OVRRenderingMode value = (OVRRenderingMode)modeProp.intValue;
value = (OVRRenderingMode)EditorGUILayout.EnumPopup("Rendering Mode", value);
modeProp.intValue = (int)value;
});
_editorDrawer.Draw(props.EnableSuperSampling, props.EmulateWhileInEditor, props.DoUnderlayAntiAliasing, (sampleProp, emulateProp, aaProp) =>
{
if (CheckIsOVR())
{
EditorGUILayout.PropertyField(sampleProp);
if (renderingMode.intValue == (int)OVRRenderingMode.Underlay)
{
EditorGUILayout.PropertyField(aaProp);
}
EditorGUILayout.PropertyField(emulateProp);
}
});
_editorDrawer.Draw(baseProps.UseAlphaToMask, baseProps.AlphaCutoutThreshold, (maskProp, cutoutProp) =>
{
if (renderingMode.intValue == (int)OVRRenderingMode.AlphaCutout)
{
EditorGUILayout.PropertyField(maskProp);
if (maskProp.boolValue == false)
{
EditorGUILayout.PropertyField(cutoutProp);
}
}
});
}
protected virtual void OnDisable()
{
}
protected void BeforeInspector()
{
AutoFix(AutoFixIsUsingMipMaps(), AutoFixDisableMipMaps,
$"{nameof(CanvasRenderTexture)} " +
$"is generating mip maps, but these are ignored when using OVR Overlay/Underlay rendering.");
}
public override void OnInspectorGUI()
{
BeforeInspector();
_editorDrawer.DrawFullInspector();
}
private bool AutoFix(bool needsFix, Action fixAction, string message)
{
if (needsFix)
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.HelpBox(message, MessageType.Warning);
if (GUILayout.Button("Auto-Fix", GUILayout.ExpandHeight(true)))
{
fixAction();
}
}
}
return needsFix;
}
private bool AutoFixIsUsingMipMaps()
{
var modeProp = serializedObject.FindProperty(baseProps.RenderingMode);
OVRRenderingMode mode = (OVRRenderingMode)modeProp.intValue;
if (mode != OVRRenderingMode.Overlay && mode != OVRRenderingMode.Underlay)
{
return false;
}
var rtProp = serializedObject.FindProperty(props.CanvasRenderTexture);
CanvasRenderTexture canvasRT = rtProp.objectReferenceValue as CanvasRenderTexture;
if (canvasRT == null)
{
return false;
}
var mipProp = new SerializedObject(canvasRT).FindProperty(rtprops.GenerateMipMaps);
return mipProp.boolValue;
}
private void AutoFixDisableMipMaps()
{
var rtProp = serializedObject.FindProperty(props.CanvasRenderTexture);
CanvasRenderTexture canvasRT = rtProp.objectReferenceValue as CanvasRenderTexture;
var rtSO = new SerializedObject(canvasRT);
var mipProp = rtSO.FindProperty(rtprops.GenerateMipMaps);
mipProp.boolValue = false;
rtSO.ApplyModifiedProperties();
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 99515fe40d88cbc438e5059565d292ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: