Merge pull request #39 from tverona1/misc

Update Unity to 2019.3.11f1 & Oculus Integration to v15.0
This commit is contained in:
tverona1
2020-04-25 14:08:44 -07:00
committed by GitHub
278 changed files with 92544 additions and 1609 deletions
+9 -11
View File
@@ -4,18 +4,16 @@
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GroundMat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _ALPHAPREMULTIPLY_ON _EMISSION
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: 3000
stringTagMap:
RenderType: Transparent
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
@@ -60,19 +58,19 @@ Material:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 3
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.2509804, g: 0.28235295, b: 0.39607844, a: 0.57254905}
- _Color: {r: 0.2509804, g: 0.2627451, b: 0.29803923, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 485ac48a563e2bf44bb4de7ead5a1f68
timeCreated: 1461716881
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: d3994560fb567c34a821fd9355c10eef
timeCreated: 1461716882
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 7000b4d67a1320940b363f3cf891dfff
timeCreated: 1461716881
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 8198ccc08475a764daaf226b841a55f1
timeCreated: 1461716882
licenseType: Store
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,36 @@
using UnityEngine;
using System.Collections;
namespace OVR
{
public class TestScript : MonoBehaviour {
[InspectorNote( "Sound Setup", "Press '1' to play testSound1 and '2' to play testSound2")]
public SoundFXRef testSound1;
public SoundFXRef testSound2;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update ()
{
// use attached game object location
if ( Input.GetKeyDown( KeyCode.Alpha1 ) )
{
testSound1.PlaySoundAt( transform.position );
}
// hard code information
if ( Input.GetKeyDown( KeyCode.Alpha2 ) ) {
testSound2.PlaySoundAt( new Vector3( 5.0f, 0.0f, 0.0f ) );
}
}
}
} // namespace OVR
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: cfae243ecd01edd49bd439c56a8b18cf
timeCreated: 1468506975
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,437 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringMode: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &767466533
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 767466535}
- component: {fileID: 767466534}
m_Layer: 0
m_Name: AudioManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &767466534
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 767466533}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6d1d30b41806244fca035fdae2896fb7, type: 3}
m_Name:
m_EditorClassIdentifier:
makePersistent: 1
enableSpatializedAudio: 1
enableSpatializedFastOverride: 0
audioMixer: {fileID: 0}
defaultMixerGroup: {fileID: 24300001, guid: 323417d454569d94fa01d511f6eb44d9, type: 2}
reservedMixerGroup: {fileID: 0}
voiceChatMixerGroup: {fileID: 0}
verboseLogging: 0
maxSoundEmitters: 32
volumeSoundFX: 1
soundFxFadeSecs: 1
audioMinFallOffDistance: 1
audioMaxFallOffDistance: 25
soundGroupings:
- name: Test Group
soundList:
- name: TestSound1
playback: 0
volume: 1
pitchVariance: {x: 0.95, y: 1.05}
falloffDistance: {x: 1, y: 25}
falloffCurve: 2
volumeFalloffCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1.0044228
inSlope: -1.9459304
outSlope: -1.9459304
tangentMode: 0
- serializedVersion: 2
time: 0.27001944
value: 0.24837627
inSlope: -1.3226271
outSlope: -1.3226271
tangentMode: 0
- serializedVersion: 2
time: 0.99744946
value: -0.0020017216
inSlope: -0.42040923
outSlope: -0.42040923
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
reverbZoneMix:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1.0044228
inSlope: -1.9459304
outSlope: -1.9459304
tangentMode: 0
- serializedVersion: 2
time: 0.36357749
value: 0.4567863
inSlope: -1.3226271
outSlope: -1.3226271
tangentMode: 0
- serializedVersion: 2
time: 0.99594045
value: 0.19572063
inSlope: -0.107312
outSlope: -0.107312
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 0
spread: 0
pctChanceToPlay: 1
priority: 0
delay: {x: 0, y: 0}
looping: 0
ospProps:
enableSpatialization: 1
useFastOverride: 1
gain: 0
enableInvSquare: 1
volumetric: 0
invSquareFalloff: {x: 1, y: 250}
soundClips:
- {fileID: 8300000, guid: 7000b4d67a1320940b363f3cf891dfff, type: 3}
- {fileID: 8300000, guid: 8198ccc08475a764daaf226b841a55f1, type: 3}
visibilityToggle: 0
- name: TestSound2
playback: 0
volume: 1
pitchVariance: {x: 0.79999995, y: 1.25}
falloffDistance: {x: 1, y: 25}
falloffCurve: 1
volumeFalloffCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMix:
serializedVersion: 2
m_Curve:
- serializedVersion: 2
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
- serializedVersion: 2
time: 1
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spread: 0
pctChanceToPlay: 1
priority: 0
delay: {x: 0, y: 0}
looping: 0
ospProps:
enableSpatialization: 1
useFastOverride: 0
gain: 0
enableInvSquare: 0
volumetric: 0
invSquareFalloff: {x: 1, y: 25}
soundClips:
- {fileID: 8300000, guid: 485ac48a563e2bf44bb4de7ead5a1f68, type: 3}
- {fileID: 8300000, guid: d3994560fb567c34a821fd9355c10eef, type: 3}
visibilityToggle: 0
mixerGroup: {fileID: 24300001, guid: 1dd706bb85d8aef4e83a6229dbd62c36, type: 2}
maxPlayingSounds: 0
preloadAudio: 0
volumeOverride: 1
playingSoundCount: 0
--- !u!4 &767466535
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 767466533}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1050355579
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1050355581}
- component: {fileID: 1050355580}
m_Layer: 0
m_Name: TestScript
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1050355580
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1050355579}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfae243ecd01edd49bd439c56a8b18cf, type: 3}
m_Name:
m_EditorClassIdentifier:
testSound1:
soundFXName: TestSound1
testSound2:
soundFXName: TestSound2
--- !u!4 &1050355581
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1050355579}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2106254871
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2106254876}
- component: {fileID: 2106254875}
- component: {fileID: 2106254874}
- component: {fileID: 2106254873}
- component: {fileID: 2106254872}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &2106254872
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2106254871}
m_Enabled: 1
--- !u!124 &2106254873
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2106254871}
m_Enabled: 1
--- !u!92 &2106254874
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2106254871}
m_Enabled: 1
--- !u!20 &2106254875
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2106254871}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &2106254876
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2106254871}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 600e5d49b0a68254286400e32c53addc
timeCreated: 1468506358
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -4,6 +4,7 @@ namespace Oculus.Platform
using System.IO;
using UnityEditor;
using UnityEngine;
using UnityEngine.Networking;
// This classes implements a UI to edit the PlatformSettings class.
// The UI is accessible from a the menu bar via: Oculus Platform -> Edit Settings
@@ -13,7 +14,7 @@ namespace Oculus.Platform
private bool isUnityEditorSettingsExpanded;
private bool isBuildSettingsExpanded;
private WWW getAccessTokenRequest;
private UnityWebRequest getAccessTokenRequest;
private void OnEnable()
{
@@ -77,7 +78,7 @@ namespace Oculus.Platform
bool HasTestAccessToken = !String.IsNullOrEmpty(StandalonePlatformSettings.OculusPlatformTestUserAccessToken);
if (PlatformSettings.UseStandalonePlatform)
{
if (!HasTestAccessToken &&
if (!HasTestAccessToken &&
(String.IsNullOrEmpty(StandalonePlatformSettings.OculusPlatformTestUserEmail) ||
String.IsNullOrEmpty(StandalonePlatformSettings.OculusPlatformTestUserPassword)))
{
@@ -124,13 +125,13 @@ namespace Oculus.Platform
if (GUILayout.Button(loginLabel))
{
WWWForm form = new WWWForm();
var headers = form.headers;
headers.Add("Authorization", "Bearer OC|1141595335965881|");
form.AddField("email", StandalonePlatformSettings.OculusPlatformTestUserEmail);
form.AddField("password", StandalonePlatformSettings.OculusPlatformTestUserPassword);
// Start the WWW request to get the access token
getAccessTokenRequest = new WWW("https://graph.oculus.com/login", form.data, headers);
getAccessTokenRequest = UnityWebRequest.Post("https://graph.oculus.com/login", form);
getAccessTokenRequest.SetRequestHeader("Authorization", "Bearer OC|1141595335965881|");
getAccessTokenRequest.SendWebRequest();
EditorApplication.update += GetAccessToken;
}
GUI.enabled = true;
@@ -187,33 +188,19 @@ namespace Oculus.Platform
#endif
if (!canEnableARM64Support)
{
EditorGUILayout.HelpBox("ARM64 support requires Unity 2018.1.x or higher.", MessageType.Info);
if (PlatformSettings.EnableARM64Support)
var msg = "Update your Unity Editor to 2018.1.x or newer to enable Arm64 support";
EditorGUILayout.HelpBox(msg, MessageType.Warning);
if (IsArm64PluginPlatformEnabled())
{
PlatformSettings.EnableARM64Support = false;
DisablePluginPlatform(PluginPlatform.Android64);
}
}
GUI.enabled = canEnableARM64Support;
var enableARM64Label = "Enable ARM64 Support [?]";
var enableARM64Hint = "[Experimental] If this is checked, Oculus Platform SDK support for ARM64 mobile devices will be enabled."
+ " Support for ARM64 must also be correctly configured in the Unity Player Settings to use this feature. Requires Unity 2018.1.x or higher.";
bool prevEnableARM64Support = PlatformSettings.EnableARM64Support;
PlatformSettings.EnableARM64Support =
MakeToggle(new GUIContent(enableARM64Label, enableARM64Hint), PlatformSettings.EnableARM64Support);
if (prevEnableARM64Support != PlatformSettings.EnableARM64Support)
else
{
if (PlatformSettings.EnableARM64Support)
if (!IsArm64PluginPlatformEnabled())
{
EnablePluginPlatform(PluginPlatform.Android64);
}
else
{
DisablePluginPlatform(PluginPlatform.Android64);
}
}
GUI.enabled = true;
@@ -232,12 +219,13 @@ namespace Oculus.Platform
if (String.IsNullOrEmpty(getAccessTokenRequest.error))
{
var Response = JsonUtility.FromJson<OculusStandalonePlatformResponse>(getAccessTokenRequest.text);
var Response = JsonUtility.FromJson<OculusStandalonePlatformResponse>(getAccessTokenRequest.downloadHandler.text);
StandalonePlatformSettings.OculusPlatformTestUserAccessToken = Response.access_token;
}
GUI.changed = true;
EditorApplication.update -= GetAccessToken;
getAccessTokenRequest.Dispose();
getAccessTokenRequest = null;
}
}
@@ -360,9 +348,11 @@ namespace Oculus.Platform
pi.SetCompatibleWithPlatform(BuildTarget.Android, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux64, false);
#if !UNITY_2019_2_OR_NEWER
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneLinux, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneLinuxUniversal, false);
#endif
#if UNITY_2017_3_OR_NEWER
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false);
#else
@@ -392,6 +382,13 @@ namespace Oculus.Platform
}
}
public static bool IsArm64PluginPlatformEnabled()
{
string path = GetPlatformPluginPath(PluginPlatform.Android64);
bool pathAlreadyExists = Directory.Exists(path) || File.Exists(path);
return pathAlreadyExists;
}
public static void EnablePluginPlatform(PluginPlatform platform)
{
string path = GetPlatformPluginPath(platform);
@@ -1,34 +1,30 @@
fileFormatVersion: 2
guid: 710d4c3bc8cf3124fa949f08710c7d9a
timeCreated: 1555100492
licenseType: Store
guid: 71f62bfe84bf80d48b4aecade2b18710
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
'': data
second:
enabled: 0
settings: {}
data:
first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARMv7
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,30 @@
fileFormatVersion: 2
guid: 5e5d140cbf7f1b64188a4a891384c5c9
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Android: Android
second:
enabled: 1
settings:
CPU: ARM64
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bd19ab760a88d4147bb139e1772b30bf
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3dce8f6f8cd6f3b4a99ef7e0708fbe76
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1 @@
APPLWRUN
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3c62fefb060a105469849eefc4530f73
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f615547c377c15c4ea2a0e37bca038c5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Resources/darwin-x86_64/liboculus_p2p.dylib</key>
<data>
JKNLD2GjErCVA+jyjwiOflKeNFE=
</data>
</dict>
<key>files2</key>
<dict>
<key>Resources/darwin-x86_64/liboculus_p2p.dylib</key>
<dict>
<key>hash2</key>
<data>
0Dix3PTkS51fqcK03xNszglO51JTVoPTad1LpFlSEzA=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e95fb942c82302a43978166bf0efaf71
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+409 -3
View File
@@ -19,6 +19,8 @@ namespace Oculus.Platform
#endif
#elif UNITY_EDITOR || UNITY_EDITOR_64
public const string DLL_NAME = "ovrplatform";
#elif UNITY_ANDROID && OVR_STANDALONE_PLATFORM
public const string DLL_NAME = "ovrplatform_standalone";
#else
public const string DLL_NAME = "ovrplatformloader";
#endif
@@ -62,6 +64,13 @@ namespace Oculus.Platform
public double doubleValue_;
};
[StructLayout(LayoutKind.Sequential)]
public struct ovrNetSyncVec3 {
public float x;
public float y;
public float z;
}
public static IntPtr ArrayOfStructsToIntPtr(Array ar)
{
int totalSize = 0;
@@ -180,6 +189,12 @@ namespace Oculus.Platform
return dt.AddSeconds(seconds_since_the_one_true_epoch).ToLocalTime();
}
public static ulong DateTimeToNative(DateTime dt) {
var universal = (dt.Kind != DateTimeKind.Utc) ? dt.ToUniversalTime() : dt;
var epochStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
return (ulong) (universal - epochStart).TotalSeconds;
}
public static byte[] BlobFromNative(uint size, IntPtr pointer) {
var a = new byte[(int)size];
for (int i = 0; i < (int)size; i++) {
@@ -262,9 +277,6 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_FreeMessage(IntPtr message);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern uint ovr_NetworkingPeer_GetSendPolicy(IntPtr networkingPeer);
// VOIP
@@ -375,6 +387,33 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Message_GetStringForJavascript")]
private static extern IntPtr ovr_Message_GetStringForJavascript_Native(IntPtr message);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetAmbisonicFloatPCM(long connection_id, float[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetAmbisonicInt16PCM(long connection_id, Int16[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetAmbisonicInterleavedFloatPCM(long connection_id, float[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetAmbisonicInterleavedInt16PCM(long connection_id, Int16[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern bool ovr_NetSync_GetListenerPosition(long connection_id, UInt64 sessionId, ref ovrNetSyncVec3 position);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetMonostreamFloatPCM(long connection_id, UInt64 sessionId, float[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetMonostreamInt16PCM(long connection_id, UInt64 session_id, Int16[] outputBuffer, UIntPtr outputBufferNumElements);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSync_GetPcmBufferMaxSamples();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_NetSync_SetListenerPosition(long connection_id, ref ovrNetSyncVec3 position);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_Net_Accept(UInt64 peerID);
@@ -747,6 +786,29 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_CloudStorage2_GetUserDirectoryPath();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_Colocation_GetCurrentMapUuid();
public static ulong ovr_Colocation_RequestMap(string uuid) {
IntPtr uuid_native = StringToNative(uuid);
var result = (ovr_Colocation_RequestMap_Native(uuid_native));
Marshal.FreeCoTaskMem(uuid_native);
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Colocation_RequestMap")]
private static extern ulong ovr_Colocation_RequestMap_Native(IntPtr uuid);
public static ulong ovr_Colocation_ShareMap(string uuid) {
IntPtr uuid_native = StringToNative(uuid);
var result = (ovr_Colocation_ShareMap_Native(uuid_native));
Marshal.FreeCoTaskMem(uuid_native);
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Colocation_ShareMap")]
private static extern ulong ovr_Colocation_ShareMap_Native(IntPtr uuid);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_Entitlement_GetIsViewerEntitled();
@@ -835,6 +897,9 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_IAP_GetViewerPurchases();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_IAP_GetViewerPurchasesDurableCache();
public static ulong ovr_IAP_LaunchCheckoutFlow(string sku) {
IntPtr sku_native = StringToNative(sku);
var result = (ovr_IAP_LaunchCheckoutFlow_Native(sku_native));
@@ -1072,6 +1137,43 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Media_ShareToFacebook")]
private static extern ulong ovr_Media_ShareToFacebook_Native(IntPtr postTextSuggestion, IntPtr filePath, MediaContentType contentType);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_Connect(IntPtr connect_options);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_Disconnect(long connection_id);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_GetSessions(long connection_id);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_GetVoipAttenuation(long connection_id);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_GetVoipAttenuationDefault();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_SetVoipAttenuation(long connection_id, float[] distances, float[] decibels, UIntPtr count);
public static ulong ovr_NetSync_SetVoipGroup(long connection_id, string group_id) {
IntPtr group_id_native = StringToNative(group_id);
var result = (ovr_NetSync_SetVoipGroup_Native(connection_id, group_id_native));
Marshal.FreeCoTaskMem(group_id_native);
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_NetSync_SetVoipGroup")]
private static extern ulong ovr_NetSync_SetVoipGroup_Native(long connection_id, IntPtr group_id);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_SetVoipMicSource(long connection_id, NetSyncVoipMicSource mic_source);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_SetVoipSessionMuted(long connection_id, UInt64 session_id, bool muted);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_NetSync_SetVoipStreamMode(long connection_id, UInt64 sessionId, NetSyncVoipStreamMode streamMode);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_Notification_GetRoomInvites();
@@ -1102,6 +1204,15 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_Party_Leave(UInt64 partyID);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_RichPresence_Clear();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_RichPresence_GetDestinations();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_RichPresence_Set(IntPtr richPresenceOptions);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern ulong ovr_Room_CreateAndJoinPrivate(RoomJoinPolicy joinPolicy, uint maxUsers, bool subscribeToUpdates);
@@ -1454,6 +1565,14 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_AssetDetails_GetLanguage(IntPtr obj);
public static string ovr_AssetDetails_GetMetadata(IntPtr obj) {
var result = StringFromNative(ovr_AssetDetails_GetMetadata_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_AssetDetails_GetMetadata")]
private static extern IntPtr ovr_AssetDetails_GetMetadata_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_AssetDetailsArray_GetElement(IntPtr obj, UIntPtr index);
@@ -1714,6 +1833,47 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_DataStore_GetValue")]
private static extern IntPtr ovr_DataStore_GetValue_Native(IntPtr obj, IntPtr key);
public static string ovr_Destination_GetApiName(IntPtr obj) {
var result = StringFromNative(ovr_Destination_GetApiName_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Destination_GetApiName")]
private static extern IntPtr ovr_Destination_GetApiName_Native(IntPtr obj);
public static string ovr_Destination_GetDeeplinkMessage(IntPtr obj) {
var result = StringFromNative(ovr_Destination_GetDeeplinkMessage_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Destination_GetDeeplinkMessage")]
private static extern IntPtr ovr_Destination_GetDeeplinkMessage_Native(IntPtr obj);
public static string ovr_Destination_GetDisplayName(IntPtr obj) {
var result = StringFromNative(ovr_Destination_GetDisplayName_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Destination_GetDisplayName")]
private static extern IntPtr ovr_Destination_GetDisplayName_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_DestinationArray_GetElement(IntPtr obj, UIntPtr index);
public static string ovr_DestinationArray_GetNextUrl(IntPtr obj) {
var result = StringFromNative(ovr_DestinationArray_GetNextUrl_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_DestinationArray_GetNextUrl")]
private static extern IntPtr ovr_DestinationArray_GetNextUrl_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_DestinationArray_GetSize(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern bool ovr_DestinationArray_HasNextPage(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern int ovr_Error_GetCode(IntPtr obj);
@@ -1827,6 +1987,14 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_LaunchDetails_GetDeeplinkMessage")]
private static extern IntPtr ovr_LaunchDetails_GetDeeplinkMessage_Native(IntPtr obj);
public static string ovr_LaunchDetails_GetDestinationApiName(IntPtr obj) {
var result = StringFromNative(ovr_LaunchDetails_GetDestinationApiName_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_LaunchDetails_GetDestinationApiName")]
private static extern IntPtr ovr_LaunchDetails_GetDestinationApiName_Native(IntPtr obj);
public static string ovr_LaunchDetails_GetLaunchSource(IntPtr obj) {
var result = StringFromNative(ovr_LaunchDetails_GetLaunchSource_Native(obj));
return result;
@@ -2143,6 +2311,12 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern uint ovr_MatchmakingStats_GetSkillLevel(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern double ovr_MatchmakingStats_GetSkillMean(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern double ovr_MatchmakingStats_GetSkillStandardDeviation(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern uint ovr_MatchmakingStats_GetWinCount(IntPtr obj);
@@ -2203,6 +2377,9 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetCloudStorageUpdateResponse(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetDestinationArray(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetError(IntPtr obj);
@@ -2266,6 +2443,21 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNativeMessage(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetSyncConnection(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetSyncSessionArray(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetSyncSessionsChangedNotification(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetSyncSetSessionPropertyResult(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetSyncVoipAttenuationValueArray(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Message_GetNetworkingPeer(IntPtr obj);
@@ -2379,6 +2571,73 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_Microphone_Stop(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern long ovr_NetSyncConnection_GetConnectionId(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern NetSyncDisconnectReason ovr_NetSyncConnection_GetDisconnectReason(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UInt64 ovr_NetSyncConnection_GetSessionId(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern NetSyncConnectionStatus ovr_NetSyncConnection_GetStatus(IntPtr obj);
public static string ovr_NetSyncConnection_GetZoneId(IntPtr obj) {
var result = StringFromNative(ovr_NetSyncConnection_GetZoneId_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_NetSyncConnection_GetZoneId")]
private static extern IntPtr ovr_NetSyncConnection_GetZoneId_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern long ovr_NetSyncSession_GetConnectionId(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern bool ovr_NetSyncSession_GetMuted(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UInt64 ovr_NetSyncSession_GetSessionId(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UInt64 ovr_NetSyncSession_GetUserId(IntPtr obj);
public static string ovr_NetSyncSession_GetVoipGroup(IntPtr obj) {
var result = StringFromNative(ovr_NetSyncSession_GetVoipGroup_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_NetSyncSession_GetVoipGroup")]
private static extern IntPtr ovr_NetSyncSession_GetVoipGroup_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_NetSyncSessionArray_GetElement(IntPtr obj, UIntPtr index);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSyncSessionArray_GetSize(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern long ovr_NetSyncSessionsChangedNotification_GetConnectionId(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_NetSyncSessionsChangedNotification_GetSessions(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_NetSyncSetSessionPropertyResult_GetSession(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern float ovr_NetSyncVoipAttenuationValue_GetDecibels(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern float ovr_NetSyncVoipAttenuationValue_GetDistance(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_NetSyncVoipAttenuationValueArray_GetElement(IntPtr obj, UIntPtr index);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_NetSyncVoipAttenuationValueArray_GetSize(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UInt64 ovr_NetworkingPeer_GetID(IntPtr obj);
@@ -2641,6 +2900,9 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Room_GetOwner(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Room_GetTeams(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern RoomType ovr_Room_GetType(IntPtr obj);
@@ -2728,6 +2990,29 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern SystemVoipStatus ovr_SystemVoipState_GetStatus(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_Team_GetAssignedUsers(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern int ovr_Team_GetMaxUsers(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern int ovr_Team_GetMinUsers(IntPtr obj);
public static string ovr_Team_GetName(IntPtr obj) {
var result = StringFromNative(ovr_Team_GetName_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_Team_GetName")]
private static extern IntPtr ovr_Team_GetName_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_TeamArray_GetElement(IntPtr obj, UIntPtr index);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UIntPtr ovr_TeamArray_GetSize(IntPtr obj);
public static string ovr_TestUser_GetAccessToken(IntPtr obj) {
var result = StringFromNative(ovr_TestUser_GetAccessToken_Native(obj));
return result;
@@ -2822,6 +3107,22 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_User_GetPresence")]
private static extern IntPtr ovr_User_GetPresence_Native(IntPtr obj);
public static string ovr_User_GetPresenceDeeplinkMessage(IntPtr obj) {
var result = StringFromNative(ovr_User_GetPresenceDeeplinkMessage_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_User_GetPresenceDeeplinkMessage")]
private static extern IntPtr ovr_User_GetPresenceDeeplinkMessage_Native(IntPtr obj);
public static string ovr_User_GetPresenceDestinationApiName(IntPtr obj) {
var result = StringFromNative(ovr_User_GetPresenceDestinationApiName_Native(obj));
return result;
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_User_GetPresenceDestinationApiName")]
private static extern IntPtr ovr_User_GetPresenceDestinationApiName_Native(IntPtr obj);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern UserPresenceStatus ovr_User_GetPresenceStatus(IntPtr obj);
@@ -3005,6 +3306,111 @@ namespace Oculus.Platform
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_MatchmakingOptions_SetEnqueueQueryKey")]
private static extern void ovr_MatchmakingOptions_SetEnqueueQueryKey_Native(IntPtr handle, IntPtr value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_NetSyncOptions_Create();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_NetSyncOptions_Destroy(IntPtr handle);
public static void ovr_NetSyncOptions_SetVoipGroup(IntPtr handle, string value) {
IntPtr value_native = StringToNative(value);
ovr_NetSyncOptions_SetVoipGroup_Native(handle, value_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_NetSyncOptions_SetVoipGroup")]
private static extern void ovr_NetSyncOptions_SetVoipGroup_Native(IntPtr handle, IntPtr value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_NetSyncOptions_SetVoipStreamDefault(IntPtr handle, NetSyncVoipStreamMode value);
public static void ovr_NetSyncOptions_SetZoneId(IntPtr handle, string value) {
IntPtr value_native = StringToNative(value);
ovr_NetSyncOptions_SetZoneId_Native(handle, value_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_NetSyncOptions_SetZoneId")]
private static extern void ovr_NetSyncOptions_SetZoneId_Native(IntPtr handle, IntPtr value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_RichPresenceOptions_Create();
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_Destroy(IntPtr handle);
public static void ovr_RichPresenceOptions_SetApiName(IntPtr handle, string value) {
IntPtr value_native = StringToNative(value);
ovr_RichPresenceOptions_SetApiName_Native(handle, value_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetApiName")]
private static extern void ovr_RichPresenceOptions_SetApiName_Native(IntPtr handle, IntPtr value);
public static void ovr_RichPresenceOptions_SetArgsString(IntPtr handle, string key, string value) {
IntPtr key_native = StringToNative(key);
IntPtr value_native = StringToNative(value);
ovr_RichPresenceOptions_SetArgsString_Native(handle, key_native, value_native);
Marshal.FreeCoTaskMem(key_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetArgsString")]
private static extern void ovr_RichPresenceOptions_SetArgsString_Native(IntPtr handle, IntPtr key, IntPtr value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_ClearArgs(IntPtr handle);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_SetCurrentCapacity(IntPtr handle, uint value);
public static void ovr_RichPresenceOptions_SetDeeplinkMessageOverride(IntPtr handle, string value) {
IntPtr value_native = StringToNative(value);
ovr_RichPresenceOptions_SetDeeplinkMessageOverride_Native(handle, value_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetDeeplinkMessageOverride")]
private static extern void ovr_RichPresenceOptions_SetDeeplinkMessageOverride_Native(IntPtr handle, IntPtr value);
public static void ovr_RichPresenceOptions_SetEndTime(IntPtr handle, DateTime value) {
ulong value_native = DateTimeToNative(value);
ovr_RichPresenceOptions_SetEndTime_Native(handle, value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetEndTime")]
private static extern void ovr_RichPresenceOptions_SetEndTime_Native(IntPtr handle, ulong value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_SetExtraContext(IntPtr handle, RichPresenceExtraContext value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_SetIsIdle(IntPtr handle, bool value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_SetIsJoinable(IntPtr handle, bool value);
public static void ovr_RichPresenceOptions_SetJoinableId(IntPtr handle, string value) {
IntPtr value_native = StringToNative(value);
ovr_RichPresenceOptions_SetJoinableId_Native(handle, value_native);
Marshal.FreeCoTaskMem(value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetJoinableId")]
private static extern void ovr_RichPresenceOptions_SetJoinableId_Native(IntPtr handle, IntPtr value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern void ovr_RichPresenceOptions_SetMaxCapacity(IntPtr handle, uint value);
public static void ovr_RichPresenceOptions_SetStartTime(IntPtr handle, DateTime value) {
ulong value_native = DateTimeToNative(value);
ovr_RichPresenceOptions_SetStartTime_Native(handle, value_native);
}
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl, EntryPoint="ovr_RichPresenceOptions_SetStartTime")]
private static extern void ovr_RichPresenceOptions_SetStartTime_Native(IntPtr handle, ulong value);
[DllImport(DLL_NAME, CallingConvention=CallingConvention.Cdecl)]
public static extern IntPtr ovr_RoomOptions_Create();
+37 -29
View File
@@ -32,14 +32,16 @@ namespace Oculus.Platform
}
#endregion
#region OnComplete Callbacks: Exposed through Oculus.Platform.Request
internal static void OnComplete<T>(Request<T> request, Message<T>.Callback callback)
#region Adding and running request handlers
internal static void AddRequest(Request request)
{
requestIDsToCallbacks[request.RequestID] = new RequestCallback<T>(callback);
}
internal static void OnComplete(Request request, Message.Callback callback)
{
requestIDsToCallbacks[request.RequestID] = new RequestCallback(callback);
if (request.RequestID == 0)
{
// An early out error happened in the C SDK. Do not add it to the mapping of callbacks
Debug.LogError("An unknown error occurred. Request failed.");
return;
}
requestIDsToRequests[request.RequestID] = request;
}
internal static void RunCallbacks()
@@ -70,10 +72,18 @@ namespace Oculus.Platform
HandleMessage(msg);
}
}
#endregion
#region Callback Internals
private static Dictionary<ulong, RequestCallback> requestIDsToCallbacks = new Dictionary<ulong, RequestCallback>();
internal static void OnApplicationQuit()
{
// Clear out all outstanding callbacks
requestIDsToRequests.Clear();
notificationCallbacks.Clear();
}
#endregion
#region Callback Internals
private static Dictionary<ulong, Request> requestIDsToRequests = new Dictionary<ulong, Request>();
private static Dictionary<Message.MessageType, RequestCallback> notificationCallbacks = new Dictionary<Message.MessageType, RequestCallback>();
private static bool hasRegisteredRoomInviteNotificationHandler = false;
@@ -119,12 +129,12 @@ namespace Oculus.Platform
if (callback != null)
{
// We need to queue up GameInvites because the callback runner will be called before a handler has beeen set.
if (!hasRegisteredRoomInviteNotificationHandler && msg.Type == Message.MessageType.Notification_Room_InviteAccepted)
{
pendingRoomInviteNotifications.Add(msg);
return;
}
// We need to queue up GameInvites because the callback runner will be called before a handler has beeen set.
if (!hasRegisteredRoomInviteNotificationHandler && msg.Type == Message.MessageType.Notification_Room_InviteAccepted)
{
pendingRoomInviteNotifications.Add(msg);
return;
}
if (msg is Message<T>)
{
@@ -138,22 +148,20 @@ namespace Oculus.Platform
}
}
private static void HandleMessage(Message msg)
internal static void HandleMessage(Message msg)
{
RequestCallback callbackHolder;
if (requestIDsToCallbacks.TryGetValue(msg.RequestID, out callbackHolder))
{
try
{
callbackHolder.HandleMessage(msg);
}
// even if there are exceptions, we should clean up cleanly
finally
{
requestIDsToCallbacks.Remove(msg.RequestID);
Request request;
if (msg.RequestID != 0 && requestIDsToRequests.TryGetValue(msg.RequestID, out request)) {
try {
request.HandleMessage(msg);
} finally {
requestIDsToRequests.Remove(msg.RequestID);
}
return;
}
else if (notificationCallbacks.TryGetValue(msg.Type, out callbackHolder))
RequestCallback callbackHolder;
if (notificationCallbacks.TryGetValue(msg.Type, out callbackHolder))
{
callbackHolder.HandleMessage(msg);
}
@@ -34,5 +34,10 @@ namespace Oculus.Platform
ovr_UnityResetTestPlatform();
#endif
}
void OnApplicationQuit()
{
Callback.OnApplicationQuit();
}
}
}
+111 -2
View File
@@ -90,6 +90,7 @@ namespace Oculus.Platform
AssetFile_Status = 0x02D32F60,
AssetFile_StatusById = 0x5D955D38,
AssetFile_StatusByName = 0x41CFDA50,
CloudStorage2_GetUserDirectoryPath = 0x76A42EEE,
CloudStorage_Delete = 0x28DA456D,
CloudStorage_GetNextCloudStorageMetadataArrayPage = 0x5C07A2EF,
CloudStorage_Load = 0x40846B41,
@@ -106,6 +107,7 @@ namespace Oculus.Platform
IAP_GetNextPurchaseArrayPage = 0x47570A95,
IAP_GetProductsBySKU = 0x7E9ACAF5,
IAP_GetViewerPurchases = 0x3A0F8419,
IAP_GetViewerPurchasesDurableCache = 0x63599E2B,
IAP_LaunchCheckoutFlow = 0x3F9B0D0D,
LanguagePack_GetCurrent = 0x1F90F0D5,
LanguagePack_SetCurrent = 0x5B4FBBE0,
@@ -139,6 +141,10 @@ namespace Oculus.Platform
Notification_GetRoomInvites = 0x6F916B92,
Notification_MarkAsRead = 0x717259E3,
Party_GetCurrent = 0x47933760,
RichPresence_Clear = 0x57B752B3,
RichPresence_GetDestinations = 0x586F2D14,
RichPresence_GetNextDestinationArrayPage = 0x67367F45,
RichPresence_Set = 0x3C147509,
Room_CreateAndJoinPrivate = 0x75D6E377,
Room_CreateAndJoinPrivate2 = 0x5A3A6243,
Room_Get = 0x659A8FB8,
@@ -202,6 +208,13 @@ namespace Oculus.Platform
/// room.
Notification_Matchmaking_MatchFound = 0x0BC3FCD7,
/// Sent when the status of a connection has changed.
Notification_NetSync_ConnectionStatusChanged = 0x073484CA,
/// Sent when the list of known connected sessions has changed. Contains the
/// new list of sessions.
Notification_NetSync_SessionsChanged = 0x387E7F36,
/// Indicates that a connection has been established or there's been an error.
/// Use NetworkingPeer.GetState() to get the result; as above,
/// NetworkingPeer.GetID() returns the ID of the peer this message is for.
@@ -223,12 +236,13 @@ namespace Oculus.Platform
/// has been inivted to as a string. Then call ovrID_FromString() to parse it
/// into an ovrID.
///
/// Note that you must call Room.Join() if you want to actually join the room.
/// Note that you must call Rooms.Join() if you want to actually join the room.
Notification_Room_InviteAccepted = 0x6D1071B1,
/// Handle this to notify the user when they've received an invitation to join
/// a room in your game. You can use this in lieu of, or in addition to,
/// polling for room invitations via Notification.GetRoomInviteNotifications().
/// polling for room invitations via
/// Notifications.GetRoomInviteNotifications().
Notification_Room_InviteReceived = 0x6A499D54,
/// Indicates that the current room has been updated. Use Message.GetRoom() to
@@ -295,6 +309,7 @@ namespace Oculus.Platform
public virtual CloudStorageMetadata GetCloudStorageMetadata() { return null; }
public virtual CloudStorageMetadataList GetCloudStorageMetadataList() { return null; }
public virtual CloudStorageUpdateResponse GetCloudStorageUpdateResponse() { return null; }
public virtual DestinationList GetDestinationList() { return null; }
public virtual InstalledApplicationList GetInstalledApplicationList() { return null; }
public virtual LaunchBlockFlowResult GetLaunchBlockFlowResult() { return null; }
public virtual LaunchFriendRequestFlowResult GetLaunchFriendRequestFlowResult() { return null; }
@@ -312,6 +327,11 @@ namespace Oculus.Platform
public virtual MatchmakingEnqueueResult GetMatchmakingEnqueueResult() { return null; }
public virtual MatchmakingEnqueueResultAndRoom GetMatchmakingEnqueueResultAndRoom() { return null; }
public virtual MatchmakingStats GetMatchmakingStats() { return null; }
public virtual NetSyncConnection GetNetSyncConnection() { return null; }
public virtual NetSyncSessionList GetNetSyncSessionList() { return null; }
public virtual NetSyncSessionsChangedNotification GetNetSyncSessionsChangedNotification() { return null; }
public virtual NetSyncSetSessionPropertyResult GetNetSyncSetSessionPropertyResult() { return null; }
public virtual NetSyncVoipAttenuationValueList GetNetSyncVoipAttenuationValueList() { return null; }
public virtual OrgScopedID GetOrgScopedID() { return null; }
public virtual Party GetParty() { return null; }
public virtual PartyID GetPartyID() { return null; }
@@ -436,6 +456,11 @@ namespace Oculus.Platform
message = new MessageWithCloudStorageUpdateResponse(messageHandle);
break;
case Message.MessageType.RichPresence_GetDestinations:
case Message.MessageType.RichPresence_GetNextDestinationArrayPage:
message = new MessageWithDestinationList(messageHandle);
break;
case Message.MessageType.ApplicationLifecycle_RegisterSessionKey:
case Message.MessageType.Entitlement_GetIsViewerEntitled:
case Message.MessageType.IAP_ConsumePurchase:
@@ -444,6 +469,8 @@ namespace Oculus.Platform
case Message.MessageType.Matchmaking_ReportResultInsecure:
case Message.MessageType.Matchmaking_StartMatch:
case Message.MessageType.Notification_MarkAsRead:
case Message.MessageType.RichPresence_Clear:
case Message.MessageType.RichPresence_Set:
case Message.MessageType.Room_LaunchInvitableUserFlow:
case Message.MessageType.Room_UpdateOwner:
case Message.MessageType.User_LaunchProfile:
@@ -497,6 +524,14 @@ namespace Oculus.Platform
message = new MessageWithMatchmakingStatsUnderMatchmakingStats(messageHandle);
break;
case Message.MessageType.Notification_NetSync_ConnectionStatusChanged:
message = new MessageWithNetSyncConnection(messageHandle);
break;
case Message.MessageType.Notification_NetSync_SessionsChanged:
message = new MessageWithNetSyncSessionsChangedNotification(messageHandle);
break;
case Message.MessageType.User_GetOrgScopedID:
message = new MessageWithOrgScopedID(messageHandle);
break;
@@ -524,6 +559,7 @@ namespace Oculus.Platform
case Message.MessageType.IAP_GetNextPurchaseArrayPage:
case Message.MessageType.IAP_GetViewerPurchases:
case Message.MessageType.IAP_GetViewerPurchasesDurableCache:
message = new MessageWithPurchaseList(messageHandle);
break;
@@ -578,6 +614,7 @@ namespace Oculus.Platform
case Message.MessageType.ApplicationLifecycle_GetSessionKey:
case Message.MessageType.Application_LaunchOtherApp:
case Message.MessageType.CloudStorage2_GetUserDirectoryPath:
case Message.MessageType.Notification_ApplicationLifecycle_LaunchIntentChanged:
case Message.MessageType.Notification_Room_InviteAccepted:
case Message.MessageType.User_GetAccessToken:
@@ -902,6 +939,18 @@ namespace Oculus.Platform
return new CloudStorageUpdateResponse(obj);
}
}
public class MessageWithDestinationList : Message<DestinationList>
{
public MessageWithDestinationList(IntPtr c_message) : base(c_message) { }
public override DestinationList GetDestinationList() { return Data; }
protected override DestinationList GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetDestinationArray(msg);
return new DestinationList(obj);
}
}
public class MessageWithInstalledApplicationList : Message<InstalledApplicationList>
{
@@ -1082,6 +1131,66 @@ namespace Oculus.Platform
return new MatchmakingStats(obj);
}
}
public class MessageWithNetSyncConnection : Message<NetSyncConnection>
{
public MessageWithNetSyncConnection(IntPtr c_message) : base(c_message) { }
public override NetSyncConnection GetNetSyncConnection() { return Data; }
protected override NetSyncConnection GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetNetSyncConnection(msg);
return new NetSyncConnection(obj);
}
}
public class MessageWithNetSyncSessionList : Message<NetSyncSessionList>
{
public MessageWithNetSyncSessionList(IntPtr c_message) : base(c_message) { }
public override NetSyncSessionList GetNetSyncSessionList() { return Data; }
protected override NetSyncSessionList GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetNetSyncSessionArray(msg);
return new NetSyncSessionList(obj);
}
}
public class MessageWithNetSyncSessionsChangedNotification : Message<NetSyncSessionsChangedNotification>
{
public MessageWithNetSyncSessionsChangedNotification(IntPtr c_message) : base(c_message) { }
public override NetSyncSessionsChangedNotification GetNetSyncSessionsChangedNotification() { return Data; }
protected override NetSyncSessionsChangedNotification GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetNetSyncSessionsChangedNotification(msg);
return new NetSyncSessionsChangedNotification(obj);
}
}
public class MessageWithNetSyncSetSessionPropertyResult : Message<NetSyncSetSessionPropertyResult>
{
public MessageWithNetSyncSetSessionPropertyResult(IntPtr c_message) : base(c_message) { }
public override NetSyncSetSessionPropertyResult GetNetSyncSetSessionPropertyResult() { return Data; }
protected override NetSyncSetSessionPropertyResult GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetNetSyncSetSessionPropertyResult(msg);
return new NetSyncSetSessionPropertyResult(obj);
}
}
public class MessageWithNetSyncVoipAttenuationValueList : Message<NetSyncVoipAttenuationValueList>
{
public MessageWithNetSyncVoipAttenuationValueList(IntPtr c_message) : base(c_message) { }
public override NetSyncVoipAttenuationValueList GetNetSyncVoipAttenuationValueList() { return Data; }
protected override NetSyncVoipAttenuationValueList GetDataFromMessage(IntPtr c_message)
{
var msg = CAPI.ovr_Message_GetNativeMessage(c_message);
var obj = CAPI.ovr_Message_GetNetSyncVoipAttenuationValueArray(msg);
return new NetSyncVoipAttenuationValueList(obj);
}
}
public class MessageWithOrgScopedID : Message<OrgScopedID>
{
@@ -4,8 +4,9 @@
// NOTE for android developers: The existence of UnityEngine.Microphone causes Unity to insert the
// android.permission.RECORD_AUDIO permission into the AndroidManifest.xml generated at build time
#if false
#if OVR_PLATFORM_USE_MICROPHONE
using UnityEngine;
using System.Collections.Generic;
namespace Oculus.Platform
{
@@ -16,12 +17,16 @@ namespace Oculus.Platform
int lastMicrophoneSample;
int micBufferSizeSamples;
private Dictionary<int, float[]> micSampleBuffers;
public MicrophoneInput()
{
int bufferLenSeconds = 1; //minimum size unity allows
int inputFreq = 48000; //this frequency is fixed throughout the voip system atm
microphoneClip = Microphone.Start(null, true, bufferLenSeconds, inputFreq);
micBufferSizeSamples = bufferLenSeconds * inputFreq;
micSampleBuffers = new Dictionary<int, float[]>();
}
public void Start()
@@ -51,7 +56,13 @@ namespace Oculus.Platform
return null;
}
float[] samples = new float[copySize]; //TODO 10376403 - pool this
float[] samples;
if (!micSampleBuffers.TryGetValue(copySize, out samples))
{
samples = new float[copySize];
micSampleBuffers[copySize] = samples;
}
microphoneClip.GetData(samples, lastMicrophoneSample);
lastMicrophoneSample = pos;
return samples;
@@ -1,9 +1,10 @@
//This file is deprecated. Use the high level voip system instead:
// https://developer.oculus.com/documentation/platform/latest/concepts/dg-cc-voip/
#if false
#if OVR_PLATFORM_USE_MICROPHONE
using UnityEngine;
using System;
using System.Collections.Generic;
namespace Oculus.Platform
{
@@ -14,12 +15,15 @@ namespace Oculus.Platform
int tempBufferSize = 960 * 10;
float[] tempBuffer;
private Dictionary<int, float[]> micSampleBuffers;
public MicrophoneInputNative()
{
mic = CAPI.ovr_Microphone_Create();
CAPI.ovr_Microphone_Start(mic);
tempBuffer = new float[tempBufferSize];
Debug.Log(mic);
micSampleBuffers = new Dictionary<int, float[]>();
}
public float[] Update()
@@ -27,10 +31,14 @@ namespace Oculus.Platform
ulong readSize = (ulong)CAPI.ovr_Microphone_ReadData(mic, tempBuffer, (UIntPtr)tempBufferSize);
if (readSize > 0)
{
float[] outBuffer = new float[readSize];
Array.Copy(tempBuffer, outBuffer, (int)readSize);
return outBuffer;
float[] samples;
if (!micSampleBuffers.TryGetValue((int)readSize, out samples))
{
samples = new float[readSize];
micSampleBuffers[(int)readSize] = samples;
}
Array.Copy(tempBuffer, samples, (int)readSize);
return samples;
}
return null;
}
@@ -21,6 +21,7 @@ namespace Oculus.Platform.Models
public readonly LanguagePackInfo LanguageOptional;
[Obsolete("Deprecated in favor of LanguageOptional")]
public readonly LanguagePackInfo Language;
public readonly string Metadata;
public AssetDetails(IntPtr o)
@@ -39,6 +40,7 @@ namespace Oculus.Platform.Models
LanguageOptional = Language;
}
}
Metadata = CAPI.ovr_AssetDetails_GetMetadata(o);
}
}
@@ -0,0 +1,38 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class Destination
{
public readonly string ApiName;
public readonly string DeeplinkMessage;
public readonly string DisplayName;
public Destination(IntPtr o)
{
ApiName = CAPI.ovr_Destination_GetApiName(o);
DeeplinkMessage = CAPI.ovr_Destination_GetDeeplinkMessage(o);
DisplayName = CAPI.ovr_Destination_GetDisplayName(o);
}
}
public class DestinationList : DeserializableList<Destination> {
public DestinationList(IntPtr a) {
var count = (int)CAPI.ovr_DestinationArray_GetSize(a);
_Data = new List<Destination>(count);
for (int i = 0; i < count; i++) {
_Data.Add(new Destination(CAPI.ovr_DestinationArray_GetElement(a, (UIntPtr)i)));
}
_NextUrl = CAPI.ovr_DestinationArray_GetNextUrl(a);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6584aafbe36b05f479abff629d533b56
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -13,6 +13,7 @@ namespace Oculus.Platform.Models
public class LaunchDetails
{
public readonly string DeeplinkMessage;
public readonly string DestinationApiName;
public readonly string LaunchSource;
public readonly LaunchType LaunchType;
public readonly UInt64 RoomID;
@@ -25,6 +26,7 @@ namespace Oculus.Platform.Models
public LaunchDetails(IntPtr o)
{
DeeplinkMessage = CAPI.ovr_LaunchDetails_GetDeeplinkMessage(o);
DestinationApiName = CAPI.ovr_LaunchDetails_GetDestinationApiName(o);
LaunchSource = CAPI.ovr_LaunchDetails_GetLaunchSource(o);
LaunchType = CAPI.ovr_LaunchDetails_GetLaunchType(o);
RoomID = CAPI.ovr_LaunchDetails_GetRoomID(o);
@@ -13,6 +13,8 @@ namespace Oculus.Platform.Models
public readonly uint DrawCount;
public readonly uint LossCount;
public readonly uint SkillLevel;
public readonly double SkillMean;
public readonly double SkillStandardDeviation;
public readonly uint WinCount;
@@ -21,6 +23,8 @@ namespace Oculus.Platform.Models
DrawCount = CAPI.ovr_MatchmakingStats_GetDrawCount(o);
LossCount = CAPI.ovr_MatchmakingStats_GetLossCount(o);
SkillLevel = CAPI.ovr_MatchmakingStats_GetSkillLevel(o);
SkillMean = CAPI.ovr_MatchmakingStats_GetSkillMean(o);
SkillStandardDeviation = CAPI.ovr_MatchmakingStats_GetSkillStandardDeviation(o);
WinCount = CAPI.ovr_MatchmakingStats_GetWinCount(o);
}
}
@@ -0,0 +1,30 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncConnection
{
public readonly long ConnectionId;
public readonly NetSyncDisconnectReason DisconnectReason;
public readonly UInt64 SessionId;
public readonly NetSyncConnectionStatus Status;
public readonly string ZoneId;
public NetSyncConnection(IntPtr o)
{
ConnectionId = CAPI.ovr_NetSyncConnection_GetConnectionId(o);
DisconnectReason = CAPI.ovr_NetSyncConnection_GetDisconnectReason(o);
SessionId = CAPI.ovr_NetSyncConnection_GetSessionId(o);
Status = CAPI.ovr_NetSyncConnection_GetStatus(o);
ZoneId = CAPI.ovr_NetSyncConnection_GetZoneId(o);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 999d2ec5f273d594d8e9c093998863a4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,41 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncSession
{
public readonly long ConnectionId;
public readonly bool Muted;
public readonly UInt64 SessionId;
public readonly UInt64 UserId;
public readonly string VoipGroup;
public NetSyncSession(IntPtr o)
{
ConnectionId = CAPI.ovr_NetSyncSession_GetConnectionId(o);
Muted = CAPI.ovr_NetSyncSession_GetMuted(o);
SessionId = CAPI.ovr_NetSyncSession_GetSessionId(o);
UserId = CAPI.ovr_NetSyncSession_GetUserId(o);
VoipGroup = CAPI.ovr_NetSyncSession_GetVoipGroup(o);
}
}
public class NetSyncSessionList : DeserializableList<NetSyncSession> {
public NetSyncSessionList(IntPtr a) {
var count = (int)CAPI.ovr_NetSyncSessionArray_GetSize(a);
_Data = new List<NetSyncSession>(count);
for (int i = 0; i < count; i++) {
_Data.Add(new NetSyncSession(CAPI.ovr_NetSyncSessionArray_GetElement(a, (UIntPtr)i)));
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bf2d6ecb34cf35843877cc075b9f17d1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncSessionsChangedNotification
{
public readonly long ConnectionId;
public readonly NetSyncSessionList Sessions;
public NetSyncSessionsChangedNotification(IntPtr o)
{
ConnectionId = CAPI.ovr_NetSyncSessionsChangedNotification_GetConnectionId(o);
Sessions = new NetSyncSessionList(CAPI.ovr_NetSyncSessionsChangedNotification_GetSessions(o));
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b74702841edb5cc48aa485d83b36ef53
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,22 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncSetSessionPropertyResult
{
public readonly NetSyncSession Session;
public NetSyncSetSessionPropertyResult(IntPtr o)
{
Session = new NetSyncSession(CAPI.ovr_NetSyncSetSessionPropertyResult_GetSession(o));
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7cc45eb009ae2c446869ed02f106f0d4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,35 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncVoipAttenuationValue
{
public readonly float Decibels;
public readonly float Distance;
public NetSyncVoipAttenuationValue(IntPtr o)
{
Decibels = CAPI.ovr_NetSyncVoipAttenuationValue_GetDecibels(o);
Distance = CAPI.ovr_NetSyncVoipAttenuationValue_GetDistance(o);
}
}
public class NetSyncVoipAttenuationValueList : DeserializableList<NetSyncVoipAttenuationValue> {
public NetSyncVoipAttenuationValueList(IntPtr a) {
var count = (int)CAPI.ovr_NetSyncVoipAttenuationValueArray_GetSize(a);
_Data = new List<NetSyncVoipAttenuationValue>(count);
for (int i = 0; i < count; i++) {
_Data.Add(new NetSyncVoipAttenuationValue(CAPI.ovr_NetSyncVoipAttenuationValueArray_GetElement(a, (UIntPtr)i)));
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c601026d7ea002640b7e4b84b835abd3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: 273ba2df3b9829e40adc85015c40e0a1
timeCreated: 1555100351
licenseType: Store
guid: ad5a1937689b9ff4896a9dcf9c558190
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
@@ -33,6 +33,10 @@ namespace Oculus.Platform.Models
public readonly User OwnerOptional;
[Obsolete("Deprecated in favor of OwnerOptional")]
public readonly User Owner;
// May be null. Check before using.
public readonly TeamList TeamsOptional;
[Obsolete("Deprecated in favor of TeamsOptional")]
public readonly TeamList Teams;
public readonly RoomType Type;
// May be null. Check before using.
public readonly UserList UsersOptional;
@@ -79,6 +83,15 @@ namespace Oculus.Platform.Models
OwnerOptional = Owner;
}
}
{
var pointer = CAPI.ovr_Room_GetTeams(o);
Teams = new TeamList(pointer);
if (pointer == IntPtr.Zero) {
TeamsOptional = null;
} else {
TeamsOptional = Teams;
}
}
Type = CAPI.ovr_Room_GetType(o);
{
var pointer = CAPI.ovr_Room_GetUsers(o);
@@ -0,0 +1,39 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform.Models
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class Team
{
public readonly UserList AssignedUsers;
public readonly int MaxUsers;
public readonly int MinUsers;
public readonly string Name;
public Team(IntPtr o)
{
AssignedUsers = new UserList(CAPI.ovr_Team_GetAssignedUsers(o));
MaxUsers = CAPI.ovr_Team_GetMaxUsers(o);
MinUsers = CAPI.ovr_Team_GetMinUsers(o);
Name = CAPI.ovr_Team_GetName(o);
}
}
public class TeamList : DeserializableList<Team> {
public TeamList(IntPtr a) {
var count = (int)CAPI.ovr_TeamArray_GetSize(a);
_Data = new List<Team>(count);
for (int i = 0; i < count; i++) {
_Data.Add(new Team(CAPI.ovr_TeamArray_GetElement(a, (UIntPtr)i)));
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 174b536e224d5b84282c6d103da9c81a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -15,6 +15,8 @@ namespace Oculus.Platform.Models
public readonly string InviteToken;
public readonly string OculusID;
public readonly string Presence;
public readonly string PresenceDeeplinkMessage;
public readonly string PresenceDestinationApiName;
public readonly UserPresenceStatus PresenceStatus;
public readonly string SmallImageUrl;
@@ -26,6 +28,8 @@ namespace Oculus.Platform.Models
InviteToken = CAPI.ovr_User_GetInviteToken(o);
OculusID = CAPI.ovr_User_GetOculusID(o);
Presence = CAPI.ovr_User_GetPresence(o);
PresenceDeeplinkMessage = CAPI.ovr_User_GetPresenceDeeplinkMessage(o);
PresenceDestinationApiName = CAPI.ovr_User_GetPresenceDestinationApiName(o);
PresenceStatus = CAPI.ovr_User_GetPresenceStatus(o);
SmallImageUrl = CAPI.ovr_User_GetSmallImageUrl(o);
}
@@ -0,0 +1,24 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using Description = System.ComponentModel.DescriptionAttribute;
public enum NetSyncConnectionStatus : int
{
[Description("UNKNOWN")]
Unknown,
[Description("CONNECTING")]
Connecting,
[Description("DISCONNECTED")]
Disconnected,
[Description("CONNECTED")]
Connected,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ea0e9a160bcaee043ac1440054b38a92
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,31 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using Description = System.ComponentModel.DescriptionAttribute;
public enum NetSyncDisconnectReason : int
{
[Description("UNKNOWN")]
Unknown,
/// when disconnect was requested
[Description("LOCAL_TERMINATED")]
LocalTerminated,
/// server intentionally closed the connection
[Description("SERVER_TERMINATED")]
ServerTerminated,
/// initial connection never succeeded
[Description("FAILED")]
Failed,
/// network timeout
[Description("LOST")]
Lost,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 104977abd9cf64c4c963c4e67b8dbe55
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,41 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class NetSyncOptions {
public NetSyncOptions() {
Handle = CAPI.ovr_NetSyncOptions_Create();
}
public void SetVoipGroup(string value) {
CAPI.ovr_NetSyncOptions_SetVoipGroup(Handle, value);
}
public void SetVoipStreamDefault(NetSyncVoipStreamMode value) {
CAPI.ovr_NetSyncOptions_SetVoipStreamDefault(Handle, value);
}
public void SetZoneId(string value) {
CAPI.ovr_NetSyncOptions_SetZoneId(Handle, value);
}
// For passing to native C
public static explicit operator IntPtr(NetSyncOptions options) {
return options != null ? options.Handle : IntPtr.Zero;
}
~NetSyncOptions() {
CAPI.ovr_NetSyncOptions_Destroy(Handle);
}
IntPtr Handle;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 45db1970b90587042b5482b011269eb9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,21 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using Description = System.ComponentModel.DescriptionAttribute;
public enum NetSyncVoipMicSource : int
{
[Description("UNKNOWN")]
Unknown,
[Description("NONE")]
None,
[Description("INTERNAL")]
Internal,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: cd5f6a5bf683b3e4a90b349e68f71116
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,21 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using Description = System.ComponentModel.DescriptionAttribute;
public enum NetSyncVoipStreamMode : int
{
[Description("UNKNOWN")]
Unknown,
[Description("AMBISONIC")]
Ambisonic,
[Description("MONO")]
Mono,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 50daa3e06daf33d418c6fa31920e590c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,8 +1,7 @@
fileFormatVersion: 2
guid: b8038de2f7a35dc45a2502f73b3ff119
timeCreated: 1555100353
licenseType: Store
guid: 81b3c8cffe3331140a62df154d710f2d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
+150 -13
View File
@@ -143,7 +143,7 @@ namespace Oculus.Platform
}
}
public static class ApplicationLifecycle
public static partial class ApplicationLifecycle
{
public static Models.LaunchDetails GetLaunchDetails() {
return new Models.LaunchDetails(CAPI.ovr_ApplicationLifecycle_GetLaunchDetails());
@@ -622,6 +622,22 @@ namespace Oculus.Platform
}
public static partial class ApplicationLifecycle
{
/// Sent when a launch intent is received (for both cold and warm starts). The
/// payload is the type of the intent. ApplicationLifecycle.GetLaunchDetails()
/// should be called to get the other details.
///
public static void SetLaunchIntentChangedNotificationCallback(Message<string>.Callback callback)
{
Callback.SetNotificationCallback(
Message.MessageType.Notification_ApplicationLifecycle_LaunchIntentChanged,
callback
);
}
}
public static partial class AssetFile
{
/// DEPRECATED. Use AssetFile.DeleteById()
@@ -970,6 +986,23 @@ namespace Oculus.Platform
}
public static partial class CloudStorage2
{
/// Get the directory path for the current user/app pair that will be used
/// during cloud storage synchronization
///
public static Request<string> GetUserDirectoryPath()
{
if (Core.IsInitialized())
{
return new Request<string>(CAPI.ovr_CloudStorage2_GetUserDirectoryPath());
}
return null;
}
}
public static partial class Colocation
{
}
@@ -1038,6 +1071,21 @@ namespace Oculus.Platform
return null;
}
/// Retrieve a list of Purchase that the Logged-In-User has made. This list
/// will only contain durable purchase (non-consumable) and is populated from a
/// device cache. It is recommended in all cases to use
/// ovr_User_GetViewerPurchases first and only check the cache if that fails.
///
public static Request<Models.PurchaseList> GetViewerPurchasesDurableCache()
{
if (Core.IsInitialized())
{
return new Request<Models.PurchaseList>(CAPI.ovr_IAP_GetViewerPurchasesDurableCache());
}
return null;
}
/// Launch the checkout flow to purchase the existing product. Oculus Home
/// tries handle and fix as many errors as possible. Home returns the
/// appropriate error message and how to resolveit, if possible. Returns a
@@ -1235,7 +1283,7 @@ namespace Oculus.Platform
///
/// Return a list of matchmaking rooms in the current pool filtered by skill
/// and ping (if enabled). This also enqueues the user in the matchmaking
/// queue. When the user has made a selection, call Room.Join2() on one of the
/// queue. When the user has made a selection, call Rooms.Join2() on one of the
/// rooms that was returned. If the user stops browsing, call
/// Matchmaking.Cancel().
///
@@ -1419,7 +1467,7 @@ namespace Oculus.Platform
///
/// Enqueue yourself to await an available matchmaking room. The platform
/// returns a MessageType.Notification_Matchmaking_MatchFound message when a
/// match is found. Call Room.Join2() on the returned room. The response
/// match is found. Call Rooms.Join2() on the returned room. The response
/// contains useful information to display to the user to set expectations for
/// how long it will take to get a match.
///
@@ -1525,7 +1573,7 @@ namespace Oculus.Platform
///
/// For pools with skill-based matching. See overview documentation above.
///
/// Call after calling Room.Join2() when the players are present to begin a
/// Call after calling Rooms.Join2() when the players are present to begin a
/// rated match for which you plan to report the results (using
/// Matchmaking.ReportResultInsecure()).
///
@@ -1582,6 +1630,31 @@ namespace Oculus.Platform
}
public static partial class NetSync
{
/// Sent when the status of a connection has changed.
///
public static void SetConnectionStatusChangedNotificationCallback(Message<Models.NetSyncConnection>.Callback callback)
{
Callback.SetNotificationCallback(
Message.MessageType.Notification_NetSync_ConnectionStatusChanged,
callback
);
}
/// Sent when the list of known connected sessions has changed. Contains the
/// new list of sessions.
///
public static void SetSessionsChangedNotificationCallback(Message<Models.NetSyncSessionsChangedNotification>.Callback callback)
{
Callback.SetNotificationCallback(
Message.MessageType.Notification_NetSync_SessionsChanged,
callback
);
}
}
public static partial class Net
{
/// Indicates that a connection has been established or there's been an error.
@@ -1678,6 +1751,46 @@ namespace Oculus.Platform
}
public static partial class RichPresence
{
/// Clear rich presence for running app
///
public static Request Clear()
{
if (Core.IsInitialized())
{
return new Request(CAPI.ovr_RichPresence_Clear());
}
return null;
}
/// Gets all the destinations that the presence can be set to
///
public static Request<Models.DestinationList> GetDestinations()
{
if (Core.IsInitialized())
{
return new Request<Models.DestinationList>(CAPI.ovr_RichPresence_GetDestinations());
}
return null;
}
/// Set rich presence for running app
///
public static Request Set(RichPresenceOptions richPresenceOptions)
{
if (Core.IsInitialized())
{
return new Request(CAPI.ovr_RichPresence_Set((IntPtr)richPresenceOptions));
}
return null;
}
}
public static partial class Rooms
{
/// DEPRECATED. Use CreateAndJoinPrivate2.
@@ -1831,9 +1944,9 @@ namespace Oculus.Platform
/// Invites a user to the specified room. They will receive a notification via
/// MessageType.Notification_Room_InviteReceived if they are in your game,
/// and/or they can poll for room invites using
/// Notification.GetRoomInviteNotifications().
/// Notifications.GetRoomInviteNotifications().
/// \param roomID The ID of your current room.
/// \param inviteToken A user's invite token, returned by Room.GetInvitableUsers().
/// \param inviteToken A user's invite token, returned by Rooms.GetInvitableUsers().
///
/// <b>Error codes</b>
/// - \b 100: The invite token has expired, the user will need to be reinvited to the room.
@@ -1961,7 +2074,7 @@ namespace Oculus.Platform
}
/// Disallow new members from being able to join the room. This will prevent
/// joins from Room.Join(), invites, 'Join From Home', etc. Users that are in
/// joins from Rooms.Join(), invites, 'Join From Home', etc. Users that are in
/// the room at the time of lockdown WILL be able to rejoin.
/// \param roomID The room whose membership you want to lock or unlock.
/// \param membershipLockStatus The new LockStatus for the room
@@ -2014,7 +2127,7 @@ namespace Oculus.Platform
/// has been inivted to as a string. Then call ovrID_FromString() to parse it
/// into an ovrID.
///
/// Note that you must call Room.Join() if you want to actually join the room.
/// Note that you must call Rooms.Join() if you want to actually join the room.
///
public static void SetRoomInviteAcceptedNotificationCallback(Message<string>.Callback callback)
{
@@ -2026,7 +2139,8 @@ namespace Oculus.Platform
/// Handle this to notify the user when they've received an invitation to join
/// a room in your game. You can use this in lieu of, or in addition to,
/// polling for room invitations via Notification.GetRoomInviteNotifications().
/// polling for room invitations via
/// Notifications.GetRoomInviteNotifications().
///
public static void SetRoomInviteReceivedNotificationCallback(Message<Models.RoomInviteNotification>.Callback callback)
{
@@ -2177,10 +2291,10 @@ namespace Oculus.Platform
}
/// Part of the scheme to confirm the identity of a particular user in your
/// backend. You can pass the result of User.GetUserProof() and a user ID from
/// User.Get() to your your backend. Your server can then use our api to verify
/// identity. 'https://graph.oculus.com/user_nonce_validate?nonce=USER_PROOF&us
/// er_id=USER_ID&access_token=ACCESS_TOKEN'
/// backend. You can pass the result of Users.GetUserProof() and a user ID from
/// Users.Get() to your your backend. Your server can then use our api to
/// verify identity. 'https://graph.oculus.com/user_nonce_validate?nonce=USER_P
/// ROOF&user_id=USER_ID&access_token=ACCESS_TOKEN'
///
/// NOTE: The nonce is only good for one check and then it is invalidated.
///
@@ -2414,6 +2528,29 @@ namespace Oculus.Platform
}
public static partial class RichPresence {
public static Request<Models.DestinationList> GetNextDestinationListPage(Models.DestinationList list) {
if (!list.HasNextPage)
{
Debug.LogWarning("Oculus.Platform.GetNextDestinationListPage: List has no next page");
return null;
}
if (Core.IsInitialized())
{
return new Request<Models.DestinationList>(
CAPI.ovr_HTTP_GetWithMessageType(
list.NextUrl,
(int)Message.MessageType.RichPresence_GetNextDestinationArrayPage
)
);
}
return null;
}
}
public static partial class Rooms {
public static Request<Models.RoomList> GetNextRoomListPage(Models.RoomList list) {
if (!list.HasNextPage)
@@ -20,7 +20,9 @@ namespace Oculus.Platform
Cal_FinalizeApplication = 0x1DA9CBD5,
Cal_GetSuggestedApplications = 0x56707015,
Cal_ProposeApplication = 0x4E83F2DD,
CloudStorage2_GetUserDirectoryPath = 0x76A42EEE,
Colocation_GetCurrentMapUuid = 0x34557EB2,
Colocation_RequestMap = 0x3215666D,
Colocation_ShareMap = 0x186DC4DD,
GraphAPI_Get = 0x30FF006E,
GraphAPI_Post = 0x76A5A7C4,
HTTP_Get = 0x6FB63223,
@@ -34,6 +36,16 @@ namespace Oculus.Platform
Livestreaming_StopStream = 0x44E40DCA,
Livestreaming_UpdateCommentsOverlayVisibility = 0x1F7D8034,
Livestreaming_UpdateMicStatus = 0x1C577D87,
NetSync_Connect = 0x646D855F,
NetSync_Disconnect = 0x1569FEB5,
NetSync_GetSessions = 0x6ED60A35,
NetSync_GetVoipAttenuation = 0x112ACA17,
NetSync_GetVoipAttenuationDefault = 0x577BA8A0,
NetSync_SetVoipAttenuation = 0x3497D7F6,
NetSync_SetVoipGroup = 0x58129C8E,
NetSync_SetVoipMicSource = 0x3302F770,
NetSync_SetVoipSessionMuted = 0x5585FF0A,
NetSync_SetVoipStreamMode = 0x67E19D37,
Party_Create = 0x1AD31B4F,
Party_GatherInApplication = 0x7287C183,
Party_Get = 0x5E8953BD,
@@ -84,8 +96,13 @@ namespace Oculus.Platform
case MessageTypeInternal.Application_ExecuteCoordinatedLaunch:
case MessageTypeInternal.Cal_ProposeApplication:
case MessageTypeInternal.Colocation_RequestMap:
case MessageTypeInternal.Colocation_ShareMap:
case MessageTypeInternal.Livestreaming_StopPartyStream:
case MessageTypeInternal.Livestreaming_UpdateMicStatus:
case MessageTypeInternal.NetSync_SetVoipAttenuation:
case MessageTypeInternal.NetSync_SetVoipGroup:
case MessageTypeInternal.NetSync_SetVoipMicSource:
case MessageTypeInternal.Party_Leave:
case MessageTypeInternal.User_CancelRecordingForReportFlow:
case MessageTypeInternal.User_TestUserCreateDeviceManifest:
@@ -129,6 +146,25 @@ namespace Oculus.Platform
message = new MessageWithLivestreamingVideoStats(messageHandle);
break;
case MessageTypeInternal.NetSync_Connect:
case MessageTypeInternal.NetSync_Disconnect:
message = new MessageWithNetSyncConnection(messageHandle);
break;
case MessageTypeInternal.NetSync_GetSessions:
message = new MessageWithNetSyncSessionList(messageHandle);
break;
case MessageTypeInternal.NetSync_SetVoipSessionMuted:
case MessageTypeInternal.NetSync_SetVoipStreamMode:
message = new MessageWithNetSyncSetSessionPropertyResult(messageHandle);
break;
case MessageTypeInternal.NetSync_GetVoipAttenuation:
case MessageTypeInternal.NetSync_GetVoipAttenuationDefault:
message = new MessageWithNetSyncVoipAttenuationValueList(messageHandle);
break;
case MessageTypeInternal.Party_Get:
message = new MessageWithParty(messageHandle);
break;
@@ -154,7 +190,7 @@ namespace Oculus.Platform
break;
case MessageTypeInternal.Avatar_UpdateMetaData:
case MessageTypeInternal.CloudStorage2_GetUserDirectoryPath:
case MessageTypeInternal.Colocation_GetCurrentMapUuid:
case MessageTypeInternal.GraphAPI_Get:
case MessageTypeInternal.GraphAPI_Post:
case MessageTypeInternal.HTTP_Get:
@@ -193,5 +229,39 @@ namespace Oculus.Platform
}
}
public static Request<Models.PlatformInitialize> InitializeStandaloneAsync(ulong appID, string accessToken)
{
var platform = new StandalonePlatform();
var initRequest = platform.AsyncInitialize(appID, accessToken);
if (initRequest == null)
{
throw new UnityException("Oculus Platform failed to initialize.");
}
// This function is not named well. Actually means that we have called platform init.
// Async initialization may not have finished at this point.
Platform.Core.ForceInitialized();
(new GameObject("Oculus.Platform.CallbackRunner")).AddComponent<CallbackRunner>();
return initRequest;
}
public static class Users
{
public static Request<Models.LinkedAccountList> GetLinkedAccounts(ServiceProvider[] providers)
{
if (Core.IsInitialized())
{
UserOptions userOpts = new UserOptions();
foreach (ServiceProvider provider in providers)
{
userOpts.AddServiceProvider(provider);
}
return new Request<Models.LinkedAccountList>(CAPI.ovr_User_GetLinkedAccounts((IntPtr)userOpts));
}
return null;
}
}
}
}
@@ -26,12 +26,6 @@ namespace Oculus.Platform
set { Instance.ovrUseStandalonePlatform = value; }
}
public static bool EnableARM64Support
{
get { return Instance.ovrEnableARM64Support; }
set { Instance.ovrEnableARM64Support = value; }
}
[SerializeField]
private string ovrAppID = "";
@@ -45,10 +39,7 @@ namespace Oculus.Platform
[SerializeField]
private bool ovrUseStandalonePlatform = true;
#endif
[SerializeField]
private bool ovrEnableARM64Support = false;
private static PlatformSettings instance;
public static PlatformSettings Instance
{
+97 -2
View File
@@ -1,27 +1,122 @@
#if OVR_PLATFORM_ASYNC_MESSAGES
using System.Threading.Tasks;
#endif
using UnityEngine;
namespace Oculus.Platform
{
public sealed class Request<T> : Request
{
#if OVR_PLATFORM_ASYNC_MESSAGES
private TaskCompletionSource<Message<T>> tcs_ = null;
#endif
private Message<T>.Callback callback_ = null;
public Request(ulong requestID) : base (requestID) { }
public Request<T> OnComplete(Message<T>.Callback callback)
{
Callback.OnComplete<T>(this, callback);
if (callback_ != null)
{
throw new UnityException("Attempted to attach multiple handlers to a Request. This is not allowed.");
}
#if OVR_PLATFORM_ASYNC_MESSAGES
if (tcs_ != null)
{
throw new UnityException("Attempted to attach multiple handlers to a Request. This is not allowed.");
}
#endif
callback_ = callback;
Callback.AddRequest(this);
return this;
}
#if OVR_PLATFORM_ASYNC_MESSAGES
new public async Task<Message<T>> Gen()
{
if (callback_ != null || tcs_ != null)
{
throw new UnityException("Attempted to attach multiple handlers to a Request. This is not allowed.");
}
tcs_ = new TaskCompletionSource<Message<T>>();
Callback.AddRequest(this);
return await tcs_.Task;
}
#endif
override public void HandleMessage(Message msg)
{
if (! (msg is Message<T>))
{
Debug.LogError("Unable to handle message: " + msg.GetType());
return;
}
#if OVR_PLATFORM_ASYNC_MESSAGES
if (tcs_ != null)
{
tcs_.SetResult( (Message<T>)msg);
return;
}
#endif
if (callback_ != null)
{
callback_( (Message<T>)msg);
return;
}
throw new UnityException("Request with no handler. This should never happen.");
}
}
public class Request
{
#if OVR_PLATFORM_ASYNC_MESSAGES
private TaskCompletionSource<Message> tcs_;
#endif
private Message.Callback callback_;
public Request(ulong requestID) {this.RequestID = requestID;}
public ulong RequestID {get; set;}
public Request OnComplete(Message.Callback callback)
{
Callback.OnComplete(this, callback);
callback_ = callback;
Callback.AddRequest(this);
return this;
}
#if OVR_PLATFORM_ASYNC_MESSAGES
public async Task<Message> Gen() {
tcs_ = new TaskCompletionSource<Message>();
Callback.AddRequest(this);
return await tcs_.Task;
}
#endif
virtual public void HandleMessage(Message msg)
{
#if OVR_PLATFORM_ASYNC_MESSAGES
if (tcs_ != null)
{
tcs_.SetResult(msg);
return;
}
#endif
if (callback_ != null)
{
callback_(msg);
return;
}
throw new UnityException("Request with no handler. This should never happen.");
}
/**
* This will run callbacks on all messages that returned from the server.
* If too many message are coming back at once, then a limit can be passed in
@@ -0,0 +1,35 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using Description = System.ComponentModel.DescriptionAttribute;
public enum RichPresenceExtraContext : int
{
[Description("UNKNOWN")]
Unknown,
/// Display nothing
[Description("NONE")]
None,
/// Display the current amount with the user over the max
[Description("CURRENT_CAPACITY")]
CurrentCapacity,
/// Display how long ago the match/game/race/etc started
[Description("STARTED_AGO")]
StartedAgo,
/// Display how soon the match/game/race/etc will end
[Description("ENDING_IN")]
EndingIn,
/// Display that this user is looking for a match
[Description("LOOKING_FOR_A_MATCH")]
LookingForAMatch,
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 507bd7426f1b9ef4c8971a42896e48ad
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,77 @@
// This file was @generated with LibOVRPlatform/codegen/main. Do not modify it!
namespace Oculus.Platform
{
using System;
using System.Collections;
using Oculus.Platform.Models;
using System.Collections.Generic;
using UnityEngine;
public class RichPresenceOptions {
public RichPresenceOptions() {
Handle = CAPI.ovr_RichPresenceOptions_Create();
}
public void SetApiName(string value) {
CAPI.ovr_RichPresenceOptions_SetApiName(Handle, value);
}
public void SetArgs(string key, string value) {
CAPI.ovr_RichPresenceOptions_SetArgsString(Handle, key, value);
}
public void ClearArgs() {
CAPI.ovr_RichPresenceOptions_ClearArgs(Handle);
}
public void SetCurrentCapacity(uint value) {
CAPI.ovr_RichPresenceOptions_SetCurrentCapacity(Handle, value);
}
public void SetDeeplinkMessageOverride(string value) {
CAPI.ovr_RichPresenceOptions_SetDeeplinkMessageOverride(Handle, value);
}
public void SetEndTime(DateTime value) {
CAPI.ovr_RichPresenceOptions_SetEndTime(Handle, value);
}
public void SetExtraContext(RichPresenceExtraContext value) {
CAPI.ovr_RichPresenceOptions_SetExtraContext(Handle, value);
}
public void SetIsIdle(bool value) {
CAPI.ovr_RichPresenceOptions_SetIsIdle(Handle, value);
}
public void SetIsJoinable(bool value) {
CAPI.ovr_RichPresenceOptions_SetIsJoinable(Handle, value);
}
public void SetJoinableId(string value) {
CAPI.ovr_RichPresenceOptions_SetJoinableId(Handle, value);
}
public void SetMaxCapacity(uint value) {
CAPI.ovr_RichPresenceOptions_SetMaxCapacity(Handle, value);
}
public void SetStartTime(DateTime value) {
CAPI.ovr_RichPresenceOptions_SetStartTime(Handle, value);
}
// For passing to native C
public static explicit operator IntPtr(RichPresenceOptions options) {
return options != null ? options.Handle : IntPtr.Zero;
}
~RichPresenceOptions() {
CAPI.ovr_RichPresenceOptions_Destroy(Handle);
}
IntPtr Handle;
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ddb3d806d2db34d448029105984a5cb0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -31,10 +31,15 @@ namespace Oculus.Platform
}
var accessToken = StandalonePlatformSettings.OculusPlatformTestUserAccessToken;
return AsyncInitialize(UInt64.Parse(appID), accessToken);
}
public Request<Models.PlatformInitialize> AsyncInitialize(ulong appID, string accessToken)
{
CAPI.ovr_UnityResetTestPlatform();
CAPI.ovr_UnityInitGlobals(IntPtr.Zero);
return new Request<Models.PlatformInitialize>(CAPI.ovr_PlatformInitializeWithAccessToken(UInt64.Parse(appID), accessToken));
return new Request<Models.PlatformInitialize>(CAPI.ovr_PlatformInitializeWithAccessToken(appID, accessToken));
}
}
}
@@ -15,17 +15,17 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>1.0.3</string>
<string>1.47.0</string>
<key>CFBundleName</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<string>1.47.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.3</string>
<string>1.47.0</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 7dc90c7d5b25dbf47ba5641abeb1c91b
timeCreated: 1560372287
guid: c68b32ff0b6f9594da6b369e3029c626
timeCreated: 1584968029
licenseType: Store
DefaultImporter:
userData:
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 43782c1bf8186e74f83d02fe5429b67d
timeCreated: 1560372287
guid: 1856ac0a07518f14cb7f7a5effb2edba
timeCreated: 1584968029
licenseType: Store
DefaultImporter:
userData:
@@ -1,25 +1,23 @@
fileFormatVersion: 2
guid: c44ae4e55ac2fc84d9a159d9da9187e7
guid: 4e72a6c3e73efa646898d748ab8d230d
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
: Editor
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
CPU: X86
OS: Windows
- first:
Any:
second:
@@ -30,47 +28,11 @@ PluginImporter:
second:
enabled: 1
settings:
CPU: x86
CPU: X86
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
@@ -78,7 +40,7 @@ PluginImporter:
- first:
Standalone: OSXUniversal
second:
enabled: 1
enabled: 0
settings:
CPU: x86
- first:
@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: c44ae4e55ac2fc84d9a159d9da9187e7
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 0
Exclude Win64: 1
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
@@ -1,25 +1,23 @@
fileFormatVersion: 2
guid: 455beaad753df474989066032533be77
guid: f879d616488d58642b9e6551294edb95
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 1
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
: Editor
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
CPU: X86_64
OS: Windows
- first:
Any:
second:
@@ -30,47 +28,11 @@ PluginImporter:
second:
enabled: 1
settings:
CPU: x86_64
CPU: X86_64
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
@@ -78,7 +40,7 @@ PluginImporter:
- first:
Standalone: OSXUniversal
second:
enabled: 1
enabled: 0
settings:
CPU: x86_64
- first:
@@ -0,0 +1,98 @@
fileFormatVersion: 2
guid: 455beaad753df474989066032533be77
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 1
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
- first:
Any:
second:
enabled: 0
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: None
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
@@ -193,7 +193,7 @@ class ONSPAudioPluginUpdater
File.Delete(newX64PluginPath);
File.Delete(newX64PluginPath + ".meta");
}
catch (Exception e)
catch (Exception e)
{
UnityEngine.Debug.LogWarning("Exception happened when deleting new spatializer plugin: " + e.Message);
}
@@ -211,6 +211,34 @@ class ONSPAudioPluginUpdater
{
File.Move(newX86PluginPath, curX86PluginPath);
File.Move(newX86PluginPath + ".meta", curX86PluginPath + ".meta");
// fix the platform
string curX86PluginPathRel = "Assets/Oculus/Spatializer/Plugins/x86/AudioPluginOculusSpatializer.dll";
UnityEngine.Debug.Log("path = " + curX86PluginPathRel);
AssetDatabase.ImportAsset(curX86PluginPathRel, ImportAssetOptions.ForceUpdate);
PluginImporter pi = PluginImporter.GetAtPath(curX86PluginPathRel) as PluginImporter;
pi.SetCompatibleWithEditor(false);
pi.SetCompatibleWithAnyPlatform(false);
pi.SetCompatibleWithPlatform(BuildTarget.Android, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, false);
#if UNITY_2017_3_OR_NEWER
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false);
#else
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
#endif
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, true);
pi.SetCompatibleWithEditor(true);
pi.SetEditorData("CPU", "X86");
pi.SetEditorData("OS", "Windows");
pi.SetPlatformData("Editor", "CPU", "X86");
pi.SetPlatformData("Editor", "OS", "Windows");
AssetDatabase.ImportAsset(curX86PluginPathRel, ImportAssetOptions.ForceUpdate);
AssetDatabase.Refresh();
AssetDatabase.SaveAssets();
upgradeDone = true;
}
catch (Exception e)
@@ -226,6 +254,34 @@ class ONSPAudioPluginUpdater
{
File.Move(newX64PluginPath, curX64PluginPath);
File.Move(newX64PluginPath + ".meta", curX64PluginPath + ".meta");
// fix the platform
string curX64PluginPathRel = "Assets/Oculus/Spatializer/Plugins/x86_64/AudioPluginOculusSpatializer.dll";
UnityEngine.Debug.Log("path = " + curX64PluginPathRel);
AssetDatabase.ImportAsset(curX64PluginPathRel, ImportAssetOptions.ForceUpdate);
PluginImporter pi = PluginImporter.GetAtPath(curX64PluginPathRel) as PluginImporter;
pi.SetCompatibleWithEditor(false);
pi.SetCompatibleWithAnyPlatform(false);
pi.SetCompatibleWithPlatform(BuildTarget.Android, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows, false);
#if UNITY_2017_3_OR_NEWER
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSX, false);
#else
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXUniversal, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel, false);
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneOSXIntel64, false);
#endif
pi.SetCompatibleWithPlatform(BuildTarget.StandaloneWindows64, true);
pi.SetCompatibleWithEditor(true);
pi.SetEditorData("CPU", "X86_64");
pi.SetEditorData("OS", "Windows");
pi.SetPlatformData("Editor", "CPU", "X86_64");
pi.SetPlatformData("Editor", "OS", "Windows");
AssetDatabase.ImportAsset(curX64PluginPathRel, ImportAssetOptions.ForceUpdate);
AssetDatabase.Refresh();
AssetDatabase.SaveAssets();
upgradeDone = true;
}
catch (Exception e)
@@ -233,7 +289,7 @@ class ONSPAudioPluginUpdater
UnityEngine.Debug.LogWarning("Unable to rename the new spatializer plugin: " + e.Message);
}
}
if (upgradeDone)
{
if (unityRunningInBatchmode
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: bc2ef71b67399574c996d4c91d1b1eb9
timeCreated: 1560372290
guid: 7f7f4173a5d8ed444b8fba9e8e086826
timeCreated: 1584968032
licenseType: Store
MonoImporter:
serializedVersion: 2
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: a983e3770a1f9574ea6cdabc7720b677
timeCreated: 1560372290
guid: 583c546491355d8449225b66c5e5e5f5
timeCreated: 1584968032
licenseType: Store
MonoImporter:
serializedVersion: 2
@@ -34,12 +34,9 @@ public enum PlayModeState
class ONSPPropagationSerializationManager
{
private static PlayModeState _currentState = PlayModeState.Stopped;
static ONSPPropagationSerializationManager()
{
EditorSceneManager.sceneSaving += OnSceneSaving;
EditorApplication.playmodeStateChanged = OnUnityPlayModeChanged;
}
public int callbackOrder { get { return 0; } }
public void OnPreprocessBuild(BuildTarget target, string path)
@@ -47,13 +44,13 @@ class ONSPPropagationSerializationManager
Debug.Log("ONSPPropagationSerializationManager.OnPreprocessBuild for target " + target + " at path " + path);
}
[MenuItem("Oculus/Oculus Spatializer/Build audio geometry for current scene")]
[MenuItem("Oculus/Spatializer/Build audio geometry for current scene")]
public static void BuildAudioGeometryForCurrentScene()
{
BuildAudioGeometryForScene(EditorSceneManager.GetActiveScene());
}
[MenuItem("Oculus/Oculus Spatializer/Rebuild audio geometry all scenes")]
[MenuItem("Oculus/Spatializer/Rebuild audio geometry all scenes")]
public static void RebuildAudioGeometryForAllScenes()
{
Debug.Log("Rebuilding geometry for all scenes");
@@ -73,7 +70,7 @@ class ONSPPropagationSerializationManager
private static void BuildAudioGeometryForScene(Scene scene)
{
Debug.Log("Building audio geometry for scene" + scene.name);
Debug.Log("Building audio geometry for scene " + scene.name);
List<GameObject> rootObjects = new List<GameObject>();
scene.GetRootGameObjects(rootObjects);
@@ -103,51 +100,4 @@ class ONSPPropagationSerializationManager
Debug.Log("Successfully built " + fileNames.Count + " geometry objects");
}
private static void OnUnityPlayModeChanged()
{
var changedState = PlayModeState.Stopped;
switch (_currentState)
{
case PlayModeState.Stopped:
if (EditorApplication.isPlayingOrWillChangePlaymode)
{
changedState = PlayModeState.Playing;
}
else if (EditorApplication.isPaused)
{
changedState = PlayModeState.Paused;
}
break;
case PlayModeState.Playing:
if (EditorApplication.isPaused)
{
changedState = PlayModeState.Paused;
}
else if (EditorApplication.isPlaying)
{
changedState = PlayModeState.Playing;
}
else
{
changedState = PlayModeState.Stopped;
}
break;
case PlayModeState.Paused:
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPaused)
{
changedState = PlayModeState.Playing;
}
else if (EditorApplication.isPlayingOrWillChangePlaymode && EditorApplication.isPaused)
{
changedState = PlayModeState.Paused;
}
break;
default:
return;
}
// Set current state.
_currentState = changedState;
}
}
@@ -42,7 +42,16 @@ public class OculusSpatializerReflectionCustomGUI : IAudioEffectPluginGUI
public override bool OnGUI(IAudioEffectPlugin plugin)
{
float fval = 0.0f;
bool bval = false;
bool bval = false;
Separator();
Label("Voice limit (1 - 1024)");
ONSPSettings.Instance.voiceLimit = EditorGUILayout.IntField(" ", ONSPSettings.Instance.voiceLimit);
if (GUI.changed)
{
GUI.changed = false;
EditorUtility.SetDirty(ONSPSettings.Instance);
}
Separator();
Label ("GLOBAL SCALE (0.00001 - 10000.0)");
@@ -35,6 +35,12 @@ public class ONSPAudioSource : MonoBehaviour
static int readOnly_NumberOfUsedSpatializedVoices = 9;
#endif
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnBeforeSceneLoadRuntimeMethod()
{
OSP_SetGlobalVoiceLimit(ONSPSettings.Instance.voiceLimit);
}
// Import functions
public const string strONSPS = "AudioPluginOculusSpatializer";
@@ -352,4 +358,7 @@ public class ONSPAudioSource : MonoBehaviour
RoomReflectionGizmoAS = null;
}
}
[System.Runtime.InteropServices.DllImport("AudioPluginOculusSpatializer")]
private static extern int OSP_SetGlobalVoiceLimit(int VoiceLimit);
}
@@ -288,8 +288,13 @@ public class ONSPPropagationGeometry : MonoBehaviour
TerrainMaterial t = terrains[i];
TerrainData terrain = t.terrain.terrainData;
#if UNITY_2019_3_OR_NEWER
int w = terrain.heightmapResolution;
int h = terrain.heightmapResolution;
#else
int w = terrain.heightmapWidth;
int h = terrain.heightmapHeight;
#endif
int wRes = (w - 1) / terrainDecimation + 1;
int hRes = (h - 1) / terrainDecimation + 1;
int vertexCount = wRes * hRes;
@@ -365,8 +370,13 @@ public class ONSPPropagationGeometry : MonoBehaviour
// Compute the combined transform to go from mesh-local to geometry-local space.
Matrix4x4 matrix = worldToLocal * t.terrain.gameObject.transform.localToWorldMatrix;
#if UNITY_2019_3_OR_NEWER
int w = terrain.heightmapResolution;
int h = terrain.heightmapResolution;
#else
int w = terrain.heightmapWidth;
int h = terrain.heightmapHeight;
#endif
float[,] tData = terrain.GetHeights(0, 0, w, h);
Vector3 meshScale = terrain.size;
@@ -3,16 +3,16 @@ Filename : ONSPPropagationInterface.cs
Content : Interface into the Oculus Audio propagation functions
Copyright : Copyright (c) Facebook Technologies, LLC and its affiliates. All rights reserved.
Licensed under the Oculus SDK Version 3.5 (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
Licensed under the Oculus SDK Version 3.5 (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/sdk-3.5/
Unless required by applicable law or agreed to in writing, the Oculus SDK
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
@@ -67,7 +67,7 @@ class ONSPPropagation
static PropagationInterface FindInterface()
{
IntPtr temp;
try
try
{
WwisePluginInterface.ovrAudio_GetPluginContext(out temp, ClientType.OVRA_CLIENT_TYPE_WWISE_UNKNOWN);
Debug.Log("Propagation initialized with Wwise Oculus Spatializer plugin");
@@ -123,6 +123,7 @@ class ONSPPropagation
public const uint OVRA_CLIENT_TYPE_TEST = 10;
public const uint OVRA_CLIENT_TYPE_OTHER = 11;
public const uint OVRA_CLIENT_TYPE_WWISE_UNKNOWN = 12;
public const uint OVRA_CLIENT_TYPE_WWISE_2019_1 = 13;
}
public interface PropagationInterface
@@ -145,9 +146,9 @@ class ONSPPropagation
int AudioGeometryWriteMeshFile(IntPtr geometry, string filePath);
int AudioGeometryReadMeshFile(IntPtr geometry, string filePath);
int AudioGeometryWriteMeshFileObj(IntPtr geometry, string filePath);
/***********************************************************************************/
// Material API
// Material API
int AudioMaterialGetFrequency(IntPtr material, MaterialProperty property, float frequency, out float value);
int CreateAudioMaterial(out IntPtr material);
int DestroyAudioMaterial(IntPtr material);
@@ -0,0 +1,47 @@
using UnityEngine;
using System.Collections;
#if UNITY_EDITOR
[UnityEditor.InitializeOnLoad]
#endif
public sealed class ONSPSettings : ScriptableObject
{
[SerializeField]
public int voiceLimit = 64;
private static ONSPSettings instance;
public static ONSPSettings Instance
{
get
{
if (instance == null)
{
instance = Resources.Load<ONSPSettings>("ONSPSettings");
// This can happen if the developer never input their App Id into the Unity Editor
// and therefore never created the OculusPlatformSettings.asset file
// Use a dummy object with defaults for the getters so we don't have a null pointer exception
if (instance == null)
{
instance = ScriptableObject.CreateInstance<ONSPSettings>();
#if UNITY_EDITOR
// Only in the editor should we save it to disk
string properPath = System.IO.Path.Combine(UnityEngine.Application.dataPath, "Resources");
if (!System.IO.Directory.Exists(properPath))
{
UnityEditor.AssetDatabase.CreateFolder("Assets", "Resources");
}
string fullPath = System.IO.Path.Combine(
System.IO.Path.Combine("Assets", "Resources"),
"ONSPSettings.asset");
UnityEditor.AssetDatabase.CreateAsset(instance, fullPath);
#endif
}
}
return instance;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad074644ff568a14187a3690cfbd7534
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto">
<!-- Request the headset DoF mode -->
<application
android:allowBackup="false">
android:label="@string/app_name"
android:icon="@mipmap/app_icon">
<activity
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
@@ -12,9 +12,10 @@
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.INFO"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
</application>
</manifest>
+5 -1
View File
@@ -121,7 +121,11 @@ public class OVRADBTool
{
string deviceName = deviceList[i];
int index = deviceName.IndexOf('\t');
deviceList[i] = deviceName.Substring(0, index);
if (index >= 0)
deviceList[i] = deviceName.Substring(0, index);
else
deviceList[i] = "";
}
return deviceList;

Some files were not shown because too many files have changed in this diff Show More