Updated oculus stuff

This commit is contained in:
Chris Midkiff
2018-10-09 20:59:57 -04:00
parent 1e7362c19f
commit 9b7f63739e
957 changed files with 128988 additions and 588 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2856d681f3672e641a2e57df9676108c
folderAsset: yes
timeCreated: 1468456735
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2a83dd010542d2744bf59af99b4bc47c
timeCreated: 1468457372
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 6b1bc2f99b5a3a042aed559717762f28
folderAsset: yes
timeCreated: 1536104808
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cfdeeba4226b23c4691e78d2432e7d88
timeCreated: 1532560992
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
This Cross Platform Unity scene demonstrates how to use Oculus Avatar SDK without the Oculus Platform SDK.
Setup instructions:
1 - Create a new Unity Project
2 - Import the Oculus Avatar SDK Unity package: https://developer.oculus.com/downloads/package/oculus-avatar-sdk/
3 - Open this CrossPlatform scene (in Assets/Oculus/Avatar/Samples/CrossPlatform)
4 - Import Oculus Utilities for Unity: https://developer.oculus.com/downloads/package/oculus-utilities-for-unity-5/
5 - Do *not* import the Oculus Platform SDK for Unity!
6 - Delete the imported SocialStarter folder from Assets/Oculus/Avatar/Samples (it demos Platform features, we don't need it for this)
7 - Use the Oculus Dashboard (https://dashboard.oculus.com/) to create a placeholder Rift app and copy the App ID
8 - Paste the App ID in Unity under Oculus Avatars > Edit Configuration > Oculus Rift App Id
9 - Enable OpenVR:
Open PlayerSettings in the Inspector tab (menu Edit > Project Settings > Player)
In PlayerSettings expand XR Settings
Under Virtual Reality SDKs, add OpenVR
10 - Click Play
Changing Avatar customization:
1 - Note the "LocalAvatar" GameObjects in the scene. Each Avatar has distinct customization.
2 - Inspect each LocalAvatar GameObject and observe the attached Ovr Avatar Script component and the "Oculus User ID" property set on each.
3 - Create your own test accounts to customize your Avatars.
4 - Use your own User IDs in this sample scene. (You will have to leave and reenter Play mode to apply Avatar User ID changes.)
Redistribution:
When packaging a Cross Platform application using Oculus Avatars, you will need to include:
* libovravatar.dll
* OvrAvatarAssets.zip
On a computer with the Oculus launcher, these files can be found in "C:\Program Files\Oculus\Support\oculus-runtime" by default.
You also need to include the Oculus Avatar SDK License, found here: https://developer.oculus.com/licenses/avatar-sdk-1.0/
In your Unity project's Assets folder, add these files to a Plugins directory.
NOTE: Unity's Build will only copy DLL files in a Plugins directory over to the output Plugins directory.
You must manually copy OvrAvatarAssets.zip to the output Plugins directory.
You can automate this process with a script adding a custom build command,
see the Unity docs here: https://docs.unity3d.com/Manual/BuildPlayerPipeline.html

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5569c00e32b73d845831ece15c9f1e36
timeCreated: 1532561014
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b8c4b9475079cf040953bf344ff4e44f
folderAsset: yes
timeCreated: 1477955918
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 697c6df5e1eddad40b634d311b0bb2e5
timeCreated: 1477966491
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 85678699140c6c3429a87f4d679b1a17
folderAsset: yes
timeCreated: 1477957292
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,31 @@
using UnityEngine;
using System.Collections;
using System;
public class PoseEditHelper : MonoBehaviour {
public Transform poseRoot;
void OnDrawGizmos()
{
if (poseRoot != null)
{
DrawJoints(poseRoot);
}
}
private void DrawJoints(Transform joint)
{
Gizmos.DrawWireSphere(joint.position, 0.005f);
for (int i = 0; i < joint.childCount; ++i)
{
Transform child = joint.GetChild(i);
if (child.name.EndsWith("_grip") || child.name.EndsWith("hand_ignore"))
{
continue;
}
Gizmos.DrawLine(joint.position, child.position);
DrawJoints(child);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6bc5b4ba964e02b4ea773b2aaca7dc67
timeCreated: 1477957304
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2883b756c033a864ca988b3f522f3339
folderAsset: yes
timeCreated: 1467313725
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,501 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
SceneSettings:
m_ObjectHideFlags: 0
m_PVSData:
m_PVSObjectsArray: []
m_PVSPortalsArray: []
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
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: 0
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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.18053587, g: 0.22601774, b: 0.30718702, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 4
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_DirectLightInLightProbes: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 1024
m_ReflectionCompression: 2
m_LightingDataAsset: {fileID: 0}
m_RuntimeCPUUsage: 25
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
accuratePlacement: 0
minRegionArea: 2
cellSize: 0.16666667
manualCellSize: 0
m_NavMeshData: {fileID: 0}
--- !u!4 &369561663 stripped
Transform:
m_PrefabParentObject: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_PrefabInternal: {fileID: 395836775}
--- !u!1001 &395836775
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1310461517}
m_Modifications:
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.w
value: -0.00000016292068
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 158226, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_Name
value: LittleAvatar
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalEulerAnglesHint.y
value: -180
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.y
value: 0.25
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.z
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: ShowThirdPerson
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: ShowFirstPerson
value: 0
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 8254050, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_ParentPrefab: {fileID: 100100000, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_IsPrefabParent: 0
--- !u!1 &957641525
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 957641529}
- 33: {fileID: 957641528}
- 65: {fileID: 957641527}
- 23: {fileID: 957641526}
m_Layer: 0
m_Name: MediumPedestal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!23 &957641526
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!65 &957641527
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &957641528
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &957641529
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 957641525}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 0}
m_LocalScale: {x: 2, y: 4, z: 2}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
--- !u!1001 &1239677853
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalPosition.z
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_RootOrder
value: 3
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400004, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 11400000, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
propertyPath: _trackingOriginType
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 126d619cf4daa52469682f85c1378b4a, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1310461516
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1310461517}
- 33: {fileID: 1310461520}
- 65: {fileID: 1310461519}
- 23: {fileID: 1310461518}
m_Layer: 0
m_Name: LittlePedestal
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1310461517
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.5, z: 0.5}
m_LocalScale: {x: 0.5, y: 1, z: 0.5}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 369561663}
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!23 &1310461518
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
m_SubsetIndices:
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedWireframeHidden: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!65 &1310461519
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1310461520
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1310461516}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1658970730
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1658970732}
- 108: {fileID: 1658970731}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1658970731
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1658970730}
m_Enabled: 1
serializedVersion: 7
m_Type: 1
m_Color: {r: 0.5955882, g: 0.5955882, b: 0.5955882, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1658970732
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1658970730}
m_LocalRotation: {x: 0.40821794, y: -0.23456973, z: 0.109381676, w: 0.87542605}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1001 &2053404217
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalPosition.z
value: -0.5
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_RootOrder
value: 4
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 463470, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
m_IsPrefabParent: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c65ef87480e70eb43931036c9c66d08d
timeCreated: 1466730185
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f26892c9951b6f54c82a5f1bf34e8d8a
folderAsset: yes
timeCreated: 1468000039
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: aa35ff5ba76fb384d839383c84209da9
timeCreated: 1468000130
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: edf34aa3892fd9f4eb0795663f7e3ffc
folderAsset: yes
timeCreated: 1468000607
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,155 @@
using UnityEngine;
using System.Collections;
using System;
using System.IO;
using Oculus.Avatar;
using System.Runtime.InteropServices;
using System.Collections.Generic;
public class RemoteLoopbackManager : MonoBehaviour
{
class PacketLatencyPair
{
public byte[] PacketData;
public float FakeLatency;
};
public OvrAvatar LocalAvatar;
public OvrAvatar LoopbackAvatar;
[System.Serializable]
public class SimulatedLatencySettings
{
[Range(0.0f, 0.5f)]
public float FakeLatencyMax = 0.25f; //250 ms max latency
[Range(0.0f, 0.5f)]
public float FakeLatencyMin = 0.002f; //2ms min latency
[Range(0.0f, 1.0f)]
public float LatencyWeight = 0.25f; // How much the latest sample impacts the current latency
[Range(0,10)]
public int MaxSamples = 4; //How many samples in our window
internal float AverageWindow = 0f;
internal float LatencySum = 0f;
internal LinkedList<float> LatencyValues = new LinkedList<float>();
public float NextValue()
{
AverageWindow = LatencySum / (float)LatencyValues.Count;
float RandomLatency = UnityEngine.Random.Range(FakeLatencyMin, FakeLatencyMax);
float FakeLatency = AverageWindow * (1f - LatencyWeight) + LatencyWeight * RandomLatency;
if (LatencyValues.Count >= MaxSamples)
{
LatencySum -= LatencyValues.First.Value;
LatencyValues.RemoveFirst();
}
LatencySum += FakeLatency;
LatencyValues.AddLast(FakeLatency);
return FakeLatency;
}
};
public SimulatedLatencySettings LatencySettings = new SimulatedLatencySettings();
private int PacketSequence = 0;
LinkedList<PacketLatencyPair> packetQueue = new LinkedList<PacketLatencyPair>();
void Start()
{
LocalAvatar.RecordPackets = true;
LocalAvatar.PacketRecorded += OnLocalAvatarPacketRecorded;
float FirstValue = UnityEngine.Random.Range(LatencySettings.FakeLatencyMin, LatencySettings.FakeLatencyMax);
LatencySettings.LatencyValues.AddFirst(FirstValue);
LatencySettings.LatencySum += FirstValue;
}
void OnLocalAvatarPacketRecorded(object sender, OvrAvatar.PacketEventArgs args)
{
using (MemoryStream outputStream = new MemoryStream())
{
BinaryWriter writer = new BinaryWriter(outputStream);
if (LocalAvatar.UseSDKPackets)
{
var size = CAPI.ovrAvatarPacket_GetSize(args.Packet.ovrNativePacket);
byte[] data = new byte[size];
CAPI.ovrAvatarPacket_Write(args.Packet.ovrNativePacket, size, data);
writer.Write(PacketSequence++);
writer.Write(size);
writer.Write(data);
}
else
{
writer.Write(PacketSequence++);
args.Packet.Write(outputStream);
}
SendPacketData(outputStream.ToArray());
}
}
void Update()
{
if (packetQueue.Count > 0)
{
List<PacketLatencyPair> deadList = new List<PacketLatencyPair>();
foreach (var packet in packetQueue)
{
packet.FakeLatency -= Time.deltaTime;
if (packet.FakeLatency < 0f)
{
ReceivePacketData(packet.PacketData);
deadList.Add(packet);
}
}
foreach (var packet in deadList)
{
packetQueue.Remove(packet);
}
}
}
void SendPacketData(byte[] data)
{
PacketLatencyPair PacketPair = new PacketLatencyPair();
PacketPair.PacketData = data;
PacketPair.FakeLatency = LatencySettings.NextValue();
packetQueue.AddLast(PacketPair);
}
void ReceivePacketData(byte[] data)
{
using (MemoryStream inputStream = new MemoryStream(data))
{
BinaryReader reader = new BinaryReader(inputStream);
int sequence = reader.ReadInt32();
OvrAvatarPacket avatarPacket;
if (LoopbackAvatar.UseSDKPackets)
{
int size = reader.ReadInt32();
byte[] sdkData = reader.ReadBytes(size);
IntPtr packet = CAPI.ovrAvatarPacket_Read((UInt32)data.Length, sdkData);
avatarPacket = new OvrAvatarPacket { ovrNativePacket = packet };
}
else
{
avatarPacket = OvrAvatarPacket.Read(inputStream);
}
LoopbackAvatar.GetComponent<OvrAvatarRemoteDriver>().QueuePacket(sequence, avatarPacket);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1675d6690178fd0459887aed66409f70
timeCreated: 1468000639
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0a4d3ea1f23c09f4594a99508091bd1a
folderAsset: yes
timeCreated: 1520618017
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2946f922e51b0d347bf529b7a7e2667e
folderAsset: yes
timeCreated: 1520618026
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,771 @@
%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: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 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.44657898, g: 0.4964133, b: 0.5748178, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
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 &8653650
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 8653655}
- component: {fileID: 8653654}
- component: {fileID: 8653653}
- component: {fileID: 8653652}
- component: {fileID: 8653651}
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 &8653651
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 0
--- !u!124 &8653652
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
--- !u!92 &8653653
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
--- !u!20 &8653654
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
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 &8653655
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 8653650}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, 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}
--- !u!1 &206856059
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 206856064}
- component: {fileID: 206856063}
- component: {fileID: 206856062}
- component: {fileID: 206856061}
- component: {fileID: 206856060}
m_Layer: 0
m_Name: RoomCamera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &206856060
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!92 &206856061
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!124 &206856062
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
--- !u!20 &206856063
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
orthographic size: 5
m_Depth: 0
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 &206856064
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 206856059}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 3, z: -9.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &780482174
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 780482176}
- component: {fileID: 780482175}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &780482175
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 780482174}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &780482176
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 780482174}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &840719025
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 840719029}
- component: {fileID: 840719028}
- component: {fileID: 840719027}
- component: {fileID: 840719026}
m_Layer: 0
m_Name: HelpPanel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &840719026
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 4c18da23435024b43a2b78449cbb6ed0, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &840719027
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &840719028
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &840719029
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 840719025}
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: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1390249324
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 100014, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_TagString
value: MainCamera
objectReference: {fileID: 0}
- target: {fileID: 100010, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: m_TagString
value: MainCamera
objectReference: {fileID: 0}
- target: {fileID: 11400002, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
propertyPath: _trackingOriginType
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1390249325 stripped
GameObject:
m_PrefabParentObject: {fileID: 100014, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!1 &1390249326 stripped
GameObject:
m_PrefabParentObject: {fileID: 100010, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!20 &1390249327
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249325}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 2
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!20 &1390249328
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249326}
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
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: 0
orthographic size: 5
m_Depth: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 1
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &1390249329 stripped
GameObject:
m_PrefabParentObject: {fileID: 100008, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 2}
m_PrefabInternal: {fileID: 1390249324}
--- !u!114 &1390249330
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1390249329}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 043fbfd0ae7027742bace7a3691feb13, type: 3}
m_Name:
m_EditorClassIdentifier:
localAvatarPrefab: {fileID: 11437430, guid: 84c8b8609f9bb434eaf5248f17ff1293, type: 2}
remoteAvatarPrefab: {fileID: 11464902, guid: 90bf33f968e6bb44ea0208fc82c90a44, type: 2}
helpPanel: {fileID: 840719025}
riftMaterial: {fileID: 2100000, guid: 3480b18dc3be4c2498fb60a71184a4d1, type: 2}
gearMaterial: {fileID: 2100000, guid: ce189bc65dde82740a5f34ef75bf87aa, type: 2}
roomSphere: {fileID: 1902705651}
roomFloor: {fileID: 2115777246}
spyCamera: {fileID: 206856063}
--- !u!1 &1902705651
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1902705655}
- component: {fileID: 1902705654}
- component: {fileID: 1902705653}
- component: {fileID: 1902705652}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &1902705652
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 296de5be1228bf34380061dd6e6b0f49, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &1902705653
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &1902705654
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1902705655
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1902705651}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 3, y: 6, z: 3}
m_LocalScale: {x: 2, y: 2, z: 2}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2115777246
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 2115777250}
- component: {fileID: 2115777249}
- component: {fileID: 2115777248}
- component: {fileID: 2115777247}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &2115777247
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: c466b89bb972b8a42bd266c102f8f2cb, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!64 &2115777248
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 3
m_Convex: 0
m_CookingOptions: 14
m_SkinWidth: 0.01
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &2115777249
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &2115777250
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 2115777246}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 7, y: 1, z: 7}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 236a5f96528802e47a70d6e47ebd3c16
timeCreated: 1496779803
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 777b874d432a52044991fe1a0210200c
folderAsset: yes
timeCreated: 1496779985
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: GearHelp
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 0453138effcc80349b11371805f72f5b, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 09c03a3c5049d234590b91bbc6e84462
timeCreated: 1497549036
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Help
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: c8f5462cc092d0c40ad71773132863e0, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4c18da23435024b43a2b78449cbb6ed0
timeCreated: 1496780065
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Offline_Mat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 296de5be1228bf34380061dd6e6b0f49
timeCreated: 1496780100
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,127 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Plane_Mat
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords: _EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailAlbedoMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailMask
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _DetailNormalMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _EmissionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MetallicGlossMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OcclusionMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParallaxMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _BumpScale
second: 1
- first:
name: _Cutoff
second: 0.5
- first:
name: _DetailNormalMapScale
second: 1
- first:
name: _DstBlend
second: 0
- first:
name: _GlossMapScale
second: 1
- first:
name: _Glossiness
second: 0.5
- first:
name: _GlossyReflections
second: 1
- first:
name: _Metallic
second: 0
- first:
name: _Mode
second: 0
- first:
name: _OcclusionStrength
second: 1
- first:
name: _Parallax
second: 0.02
- first:
name: _SmoothnessTextureChannel
second: 0
- first:
name: _SpecularHighlights
second: 1
- first:
name: _SrcBlend
second: 1
- first:
name: _UVSec
second: 0
- first:
name: _ZWrite
second: 1
m_Colors:
- first:
name: _Color
second: {r: 0, g: 0.25517225, b: 1, a: 1}
- first:
name: _EmissionColor
second: {r: 0, g: 0, b: 0, a: 1}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c466b89bb972b8a42bd266c102f8f2cb
timeCreated: 1496780131
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f05e47c366870a44ab2b3b5a8a64e107
folderAsset: yes
timeCreated: 1496780004
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,231 @@
using UnityEngine;
using System;
using Oculus.Platform;
using Oculus.Platform.Models;
// Helper class to manage a Peer-to-Peer connection to the other user.
// The connection is used to send and received the Transforms for the
// Avatars. The Transforms are sent via unreliable UDP at a fixed
// frequency.
public class P2PManager
{
// packet header is a message type byte
private enum MessageType : byte
{
Update = 1,
};
public P2PManager()
{
Net.SetPeerConnectRequestCallback(PeerConnectRequestCallback);
Net.SetConnectionStateChangedCallback(ConnectionStateChangedCallback);
}
#region Connection Management
public void ConnectTo(ulong userID)
{
// ID comparison is used to decide who calls Connect and who calls Accept
if (SocialPlatformManager.MyID < userID)
{
Net.Connect(userID);
SocialPlatformManager.LogOutput("P2P connect to " + userID);
}
}
public void Disconnect(ulong userID)
{
if (userID != 0)
{
Net.Close(userID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(userID);
if (remote != null)
{
remote.p2pConnectionState = PeerConnectionState.Unknown;
}
}
}
void PeerConnectRequestCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("P2P request from " + msg.Data.ID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
SocialPlatformManager.LogOutput("P2P request accepted from " + msg.Data.ID);
Net.Accept(msg.Data.ID);
}
}
void ConnectionStateChangedCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("P2P state to " + msg.Data.ID + " changed to " + msg.Data.State);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
remote.p2pConnectionState = msg.Data.State;
if (msg.Data.State == PeerConnectionState.Timeout &&
// ID comparison is used to decide who calls Connect and who calls Accept
SocialPlatformManager.MyID < msg.Data.ID)
{
// keep trying until hangup!
Net.Connect(msg.Data.ID);
SocialPlatformManager.LogOutput("P2P re-connect to " + msg.Data.ID);
}
}
}
#endregion
#region Message Sending
public void SendAvatarUpdate(ulong userID, Transform bodyTransform, UInt32 sequence, byte[] avatarPacket)
{
const int UPDATE_DATA_LENGTH = 41;
byte[] sendBuffer = new byte[avatarPacket.Length + UPDATE_DATA_LENGTH];
int offset = 0;
PackByte((byte)MessageType.Update, sendBuffer, ref offset);
PackULong(SocialPlatformManager.MyID, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.x, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.y, sendBuffer, ref offset);
PackFloat(bodyTransform.localPosition.z, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.x, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.y, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.z, sendBuffer, ref offset);
PackFloat(bodyTransform.localRotation.w, sendBuffer, ref offset);
PackUInt32(sequence, sendBuffer, ref offset);
Debug.Assert(offset == UPDATE_DATA_LENGTH);
Buffer.BlockCopy(avatarPacket, 0, sendBuffer, offset, avatarPacket.Length);
Net.SendPacket(userID, sendBuffer, SendPolicy.Unreliable);
}
#endregion
#region Message Receiving
public void GetRemotePackets()
{
Packet packet;
while ((packet = Net.ReadPacket()) != null)
{
byte[] receiveBuffer = new byte[packet.Size];
packet.ReadBytes(receiveBuffer);
int offset = 0;
MessageType messageType = (MessageType)ReadByte(receiveBuffer, ref offset);
ulong remoteUserID = ReadULong(receiveBuffer, ref offset);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(remoteUserID);
if (remote == null)
{
SocialPlatformManager.LogOutput("Unknown remote player: " + remoteUserID);
continue;
}
if (messageType == MessageType.Update)
{
processAvatarPacket(remote, ref receiveBuffer, ref offset);
}
else
{
SocialPlatformManager.LogOutput("Invalid packet type: " + packet.Size);
continue;
}
}
}
public void processAvatarPacket(RemotePlayer remote, ref byte[] packet, ref int offset)
{
if (remote == null)
return;
remote.receivedBodyPositionPrior = remote.receivedBodyPosition;
remote.receivedBodyPosition.x = ReadFloat(packet, ref offset);
remote.receivedBodyPosition.y = ReadFloat(packet, ref offset);
remote.receivedBodyPosition.z = ReadFloat(packet, ref offset);
remote.receivedBodyRotationPrior = remote.receivedBodyRotation;
remote.receivedBodyRotation.x = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.y = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.z = ReadFloat(packet, ref offset);
remote.receivedBodyRotation.w = ReadFloat(packet, ref offset);
remote.RemoteAvatar.transform.localPosition = remote.receivedBodyPosition;
remote.RemoteAvatar.transform.localRotation = remote.receivedBodyRotation;
// forward the remaining data to the avatar system
int sequence = (int)ReadUInt32(packet, ref offset);
byte[] remainingAvatarBuffer = new byte[packet.Length - offset];
Buffer.BlockCopy(packet, offset, remainingAvatarBuffer, 0, remainingAvatarBuffer.Length);
IntPtr avatarPacket = Oculus.Avatar.CAPI.ovrAvatarPacket_Read((UInt32)remainingAvatarBuffer.Length, remainingAvatarBuffer);
var ovravatarPacket = new OvrAvatarPacket { ovrNativePacket = avatarPacket };
remote.RemoteAvatar.GetComponent<OvrAvatarRemoteDriver>().QueuePacket(sequence, ovravatarPacket);
}
#endregion
#region Serialization
void PackByte(byte b, byte[] buf, ref int offset)
{
buf[offset] = b;
offset += sizeof(byte);
}
byte ReadByte(byte[] buf, ref int offset)
{
byte val = buf[offset];
offset += sizeof(byte);
return val;
}
void PackFloat(float f, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(f), 0, buf, offset, sizeof(float));
offset += sizeof(float);
}
float ReadFloat(byte[] buf, ref int offset)
{
float val = BitConverter.ToSingle(buf, offset);
offset += sizeof(float);
return val;
}
void PackULong(ulong u, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(u), 0, buf, offset, sizeof(ulong));
offset += sizeof(ulong);
}
ulong ReadULong(byte[] buf, ref int offset)
{
ulong val = BitConverter.ToUInt64(buf, offset);
offset += sizeof(ulong);
return val;
}
void PackUInt32(UInt32 u, byte[] buf, ref int offset)
{
Buffer.BlockCopy(BitConverter.GetBytes(u), 0, buf, offset, sizeof(UInt32));
offset += sizeof(UInt32);
}
UInt32 ReadUInt32(byte[] buf, ref int offset)
{
UInt32 val = BitConverter.ToUInt32(buf, offset);
offset += sizeof(UInt32);
return val;
}
#endregion
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e5d77a60e86b5bd4a999ef6c83f9e651
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,101 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;
using Oculus.Platform.Models;
public class PlayerController : SocialPlatformManager
{
// Secondary camera to debug and view the whole scene from above
public Camera spyCamera;
// The OVRCameraRig for the main player so we can disable it
private GameObject cameraRig;
private bool showUI = true;
public override void Awake()
{
base.Awake();
cameraRig = localPlayerHead.gameObject;
}
// Use this for initialization
public override void Start()
{
base.Start();
spyCamera.enabled = false;
}
// Update is called once per frame
public override void Update()
{
base.Update();
checkInput();
}
// Check for input from the touch controllers
void checkInput()
{
if (UnityEngine.Application.platform == RuntimePlatform.Android)
{
// GearVR Controller
// Bring up friend invite list
if (OVRInput.GetDown(OVRInput.Button.Back))
{
Rooms.LaunchInvitableUserFlow(roomManager.roomID);
}
// Toggle Camera
if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad))
{
ToggleCamera();
}
// Toggle Help UI
if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))
{
ToggleUI();
}
}
else
{
// PC Touch
// Bring up friend invite list
if (OVRInput.GetDown(OVRInput.Button.Three))
{
Rooms.LaunchInvitableUserFlow (roomManager.roomID);
}
// Toggle Camera
if (OVRInput.GetDown(OVRInput.Button.Four))
{
ToggleCamera();
}
// Toggle Help UI
if (OVRInput.GetDown(OVRInput.Button.PrimaryThumbstick))
{
ToggleUI();
}
}
}
void ToggleCamera()
{
spyCamera.enabled = !spyCamera.enabled;
localAvatar.ShowThirdPerson = !localAvatar.ShowThirdPerson;
cameraRig.SetActive(!cameraRig.activeSelf);
}
void ToggleUI()
{
showUI = !showUI;
helpPanel.SetActive(showUI);
localAvatar.ShowLeftController(showUI);
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 043fbfd0ae7027742bace7a3691feb13
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Oculus.Platform;
public class RemotePlayer
{
public ulong remoteUserID;
public bool stillInRoom;
// the result of the last connection state update message
public PeerConnectionState p2pConnectionState;
// the last reported state of the VOIP connection
public PeerConnectionState voipConnectionState;
public OvrAvatar RemoteAvatar;
// the last received position updates
public Vector3 receivedBodyPosition;
// the previous received positions to interpolate from
public Vector3 receivedBodyPositionPrior;
// the last received rotation updates
public Quaternion receivedBodyRotation;
// the previous received rotations to interpolate from
public Quaternion receivedBodyRotationPrior;
// the voip tracker for the player
public VoipAudioSourceHiLevel voipSource;
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: e5bc955e8176ef1478360f25ef5ccc8a
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,225 @@
using UnityEngine;
using System;
using System.Collections.Generic;
using Oculus.Platform;
using Oculus.Platform.Models;
// Helper class to manage Room creation, membership and invites.
// Rooms are a mechanism to help Oculus users create a shared experience.
// Users can only be in one Room at a time. If the Owner of a room
// leaves, then ownership is transferred to some other member.
// Here we use rooms to create the notion of a 'call' to help us
// invite a Friend and establish a VOIP and P2P connection.
public class RoomManager
{
// the ID of the Room that I'm in
public ulong roomID;
// the ID of the Room that I'm invited to
private ulong invitedRoomID;
// Am I the server?
private bool amIServer;
// Have we already gone through the startup?
private bool startupDone;
public RoomManager()
{
amIServer = false;
startupDone = false;
Rooms.SetRoomInviteAcceptedNotificationCallback(AcceptingInviteCallback);
Rooms.SetUpdateNotificationCallback(RoomUpdateCallback);
}
#region Launched Application from Accepting Invite
// Callback to check whether the User accepted an invite
void AcceptingInviteCallback(Message<string> msg)
{
if (msg.IsError)
{
SocialPlatformManager.TerminateWithError(msg);
return;
}
SocialPlatformManager.LogOutput("Launched Invite to join Room: " + msg.Data);
invitedRoomID = Convert.ToUInt64(msg.GetString());
if (startupDone)
{
CheckForInvite();
}
}
// Check to see if the App was launched by accepting the Notication from the main Oculus app.
// If so, we can directly join that room. (If it's still available.)
public bool CheckForInvite()
{
startupDone = true;
if (invitedRoomID != 0)
{
JoinExistingRoom(invitedRoomID);
return true;
}
else
{
return false;
}
}
#endregion
#region Create a Room and Invite Friend(s) from the Oculus Universal Menu
public void CreateRoom()
{
Rooms.CreateAndJoinPrivate(RoomJoinPolicy.FriendsOfOwner, 4, true)
.OnComplete(CreateAndJoinPrivateRoomCallback);
}
void CreateAndJoinPrivateRoomCallback(Message<Oculus.Platform.Models.Room> msg)
{
if (msg.IsError)
{
SocialPlatformManager.TerminateWithError(msg);
return;
}
roomID = msg.Data.ID;
if (msg.Data.OwnerOptional != null && msg.Data.OwnerOptional.ID == SocialPlatformManager.MyID)
{
amIServer = true;
}
else
{
amIServer = false;
}
SocialPlatformManager.TransitionToState(SocialPlatformManager.State.WAITING_IN_A_ROOM);
SocialPlatformManager.SetFloorColorForState(amIServer);
}
void OnLaunchInviteWorkflowComplete(Message msg)
{
if (msg.IsError)
{
SocialPlatformManager.TerminateWithError(msg);
return;
}
}
#endregion
#region Accept Invite
public void JoinExistingRoom(ulong roomID)
{
SocialPlatformManager.TransitionToState(SocialPlatformManager.State.JOINING_A_ROOM);
Rooms.Join(roomID, true).OnComplete(JoinRoomCallback);
}
void JoinRoomCallback(Message<Oculus.Platform.Models.Room> msg)
{
if (msg.IsError)
{
// is reasonable if caller called more than 1 person, and I didn't answer first
return;
}
var ownerOculusId = msg.Data.OwnerOptional != null ? msg.Data.OwnerOptional.OculusID : "null";
var userCount = msg.Data.UsersOptional != null ? msg.Data.UsersOptional.Count : 0;
SocialPlatformManager.LogOutput("Joined Room " + msg.Data.ID + " owner: " + ownerOculusId + " count: " + userCount);
roomID = msg.Data.ID;
ProcessRoomData(msg);
}
#endregion
#region Room Updates
void RoomUpdateCallback(Message<Oculus.Platform.Models.Room> msg)
{
if (msg.IsError)
{
SocialPlatformManager.TerminateWithError(msg);
return;
}
var ownerOculusId = msg.Data.OwnerOptional != null ? msg.Data.OwnerOptional.OculusID : "null";
var userCount = msg.Data.UsersOptional != null ? msg.Data.UsersOptional.Count : 0;
SocialPlatformManager.LogOutput("Room Update " + msg.Data.ID + " owner: " + ownerOculusId + " count: " + userCount);
ProcessRoomData(msg);
}
#endregion
#region Room Exit
public void LeaveCurrentRoom()
{
if (roomID != 0)
{
Rooms.Leave(roomID);
roomID = 0;
}
SocialPlatformManager.TransitionToState(SocialPlatformManager.State.LEAVING_A_ROOM);
}
#endregion
#region Process Room Data
void ProcessRoomData(Message<Oculus.Platform.Models.Room> msg)
{
if (msg.Data.OwnerOptional != null && msg.Data.OwnerOptional.ID == SocialPlatformManager.MyID)
{
amIServer = true;
}
else
{
amIServer = false;
}
// if the caller left while I was in the process of joining, just use that as our new room
if (msg.Data.UsersOptional != null && msg.Data.UsersOptional.Count == 1)
{
SocialPlatformManager.TransitionToState(SocialPlatformManager.State.WAITING_IN_A_ROOM);
}
else
{
SocialPlatformManager.TransitionToState(SocialPlatformManager.State.CONNECTED_IN_A_ROOM);
}
// Look for users that left
SocialPlatformManager.MarkAllRemoteUsersAsNotInRoom();
if (msg.Data.UsersOptional != null)
{
foreach (User user in msg.Data.UsersOptional)
{
if (user.ID != SocialPlatformManager.MyID)
{
if (!SocialPlatformManager.IsUserInRoom(user.ID))
{
SocialPlatformManager.AddRemoteUser(user.ID);
}
else
{
SocialPlatformManager.MarkRemoteUserInRoom(user.ID);
}
}
}
}
SocialPlatformManager.ForgetRemoteUsersNotInRoom();
SocialPlatformManager.SetFloorColorForState(amIServer);
}
#endregion
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 923f57b3cf1990047b2e448680c8d5b8
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,556 @@
using UnityEngine;
using System;
using System.IO;
using System.Collections.Generic;
using Oculus.Avatar;
using Oculus.Platform;
using Oculus.Platform.Models;
// This class coordinates communication with the Oculus Platform
// Service running in your device.
public class SocialPlatformManager : MonoBehaviour
{
private static readonly Vector3 START_ROTATION_ONE = new Vector3(0, 180, 0);
private static readonly Vector3 START_POSITION_ONE = new Vector3(0, 4, 5);
private static readonly Vector3 START_ROTATION_TWO = new Vector3(0, 0, 0);
private static readonly Vector3 START_POSITION_TWO = new Vector3(0, 4, -5);
private static readonly Vector3 START_ROTATION_THREE = new Vector3(0, 270, 0);
private static readonly Vector3 START_POSITION_THREE = new Vector3(5, 4, 0);
private static readonly Vector3 START_ROTATION_FOUR = new Vector3(0, 90, 0);
private static readonly Vector3 START_POSITION_FOUR = new Vector3(-5, 4, 0);
private static readonly Color BLACK = new Color(0.0f, 0.0f, 0.0f);
private static readonly Color WHITE = new Color(1.0f, 1.0f, 1.0f);
private static readonly Color CYAN = new Color(0.0f, 1.0f, 1.0f);
private static readonly Color BLUE = new Color(0.0f, 0.0f, 1.0f);
private static readonly Color GREEN = new Color(0.0f, 1.0f, 0.0f);
public Oculus.Platform.CAPI.FilterCallback micFilterDelegate = new Oculus.Platform.CAPI.FilterCallback(SocialPlatformManager.MicFilter);
private float voiceCurrent = 0.0f;
// Local player
private UInt32 packetSequence = 0;
public OvrAvatar localAvatarPrefab;
public OvrAvatar remoteAvatarPrefab;
public GameObject helpPanel;
protected MeshRenderer helpMesh;
public Material riftMaterial;
public Material gearMaterial;
protected OvrAvatar localAvatar;
protected GameObject localTrackingSpace;
protected GameObject localPlayerHead;
// Remote players
protected Dictionary<ulong, RemotePlayer> remoteUsers = new Dictionary<ulong, RemotePlayer>();
// GameObject that represents the center sphere as a visual status indicator of the room
public GameObject roomSphere;
protected MeshRenderer sphereMesh;
public GameObject roomFloor;
protected MeshRenderer floorMesh;
protected State currentState;
protected static SocialPlatformManager s_instance = null;
protected RoomManager roomManager;
protected P2PManager p2pManager;
protected VoipManager voipManager;
// my Application-scoped Oculus ID
protected ulong myID;
// my Oculus user name
protected string myOculusID;
// animating the mouth for voip
public static readonly float VOIP_SCALE = 2f;
public virtual void Update()
{
// Look for updates from remote users
p2pManager.GetRemotePackets();
// update avatar mouths to match voip volume
foreach (KeyValuePair<ulong, RemotePlayer> kvp in remoteUsers)
{
float remoteVoiceCurrent = Mathf.Clamp(kvp.Value.voipSource.peakAmplitude * VOIP_SCALE, 0f, 1f);
kvp.Value.RemoteAvatar.VoiceAmplitude = remoteVoiceCurrent;
}
if (localAvatar != null)
{
localAvatar.VoiceAmplitude = Mathf.Clamp(voiceCurrent * VOIP_SCALE, 0f, 1f);
}
}
#region Initialization and Shutdown
public virtual void Awake()
{
LogOutputLine("Start Log.");
// Grab the MeshRenderers. We'll be using the material colour to visually show status
helpMesh = helpPanel.GetComponent<MeshRenderer>();
sphereMesh = roomSphere.GetComponent<MeshRenderer>();
floorMesh = roomFloor.GetComponent<MeshRenderer>();
// Set up the local player
localTrackingSpace = this.transform.Find("OVRCameraRig/TrackingSpace").gameObject;
localPlayerHead = this.transform.Find("OVRCameraRig/TrackingSpace/CenterEyeAnchor").gameObject;
// make sure only one instance of this manager ever exists
if (s_instance != null)
{
Destroy(gameObject);
return;
}
s_instance = this;
DontDestroyOnLoad(gameObject);
TransitionToState(State.INITIALIZING);
Core.Initialize();
roomManager = new RoomManager();
p2pManager = new P2PManager();
voipManager = new VoipManager();
}
public virtual void Start()
{
// First thing we should do is perform an entitlement check to make sure
// we successfully connected to the Oculus Platform Service.
Entitlements.IsUserEntitledToApplication().OnComplete(IsEntitledCallback);
Oculus.Platform.Request.RunCallbacks();
}
void IsEntitledCallback(Message msg)
{
if (msg.IsError)
{
TerminateWithError(msg);
return;
}
// Next get the identity of the user that launched the Application.
Users.GetLoggedInUser().OnComplete(GetLoggedInUserCallback);
Oculus.Platform.Request.RunCallbacks();
}
void GetLoggedInUserCallback(Message<User> msg)
{
if (msg.IsError)
{
TerminateWithError(msg);
return;
}
myID = msg.Data.ID;
myOculusID = msg.Data.OculusID;
localAvatar = Instantiate(localAvatarPrefab);
localTrackingSpace = this.transform.Find("OVRCameraRig/TrackingSpace").gameObject;
localAvatar.transform.SetParent(localTrackingSpace.transform, false);
localAvatar.transform.localPosition = new Vector3(0, 0, 0);
localAvatar.transform.localRotation = Quaternion.identity;
if (UnityEngine.Application.platform == RuntimePlatform.Android)
{
helpPanel.transform.SetParent(localAvatar.transform.Find("body"), false);
helpPanel.transform.localPosition = new Vector3(0, 1.0f, 1.0f);
helpMesh.material = gearMaterial;
}
else
{
helpPanel.transform.SetParent(localAvatar.transform.Find("hand_left"), false);
helpPanel.transform.localPosition = new Vector3(0, 0.2f, 0.2f);
helpMesh.material = riftMaterial;
}
localAvatar.oculusUserID = myID.ToString();
localAvatar.RecordPackets = true;
localAvatar.PacketRecorded += OnLocalAvatarPacketRecorded;
localAvatar.EnableMouthVertexAnimation = true;
Quaternion rotation = Quaternion.identity;
switch (UnityEngine.Random.Range(0, 4))
{
case 0:
rotation.eulerAngles = START_ROTATION_ONE;
this.transform.localPosition = START_POSITION_ONE;
this.transform.localRotation = rotation;
break;
case 1:
rotation.eulerAngles = START_ROTATION_TWO;
this.transform.localPosition = START_POSITION_TWO;
this.transform.localRotation = rotation;
break;
case 2:
rotation.eulerAngles = START_ROTATION_THREE;
this.transform.localPosition = START_POSITION_THREE;
this.transform.localRotation = rotation;
break;
case 3:
default:
rotation.eulerAngles = START_ROTATION_FOUR;
this.transform.localPosition = START_POSITION_FOUR;
this.transform.localRotation = rotation;
break;
}
TransitionToState(State.CHECKING_LAUNCH_STATE);
// If the user launched the app by accepting the notification, then we want to
// join that room. If not, try to find a friend's room to join
if (!roomManager.CheckForInvite())
{
SocialPlatformManager.LogOutput("No invite on launch, looking for a friend to join.");
Users.GetLoggedInUserFriendsAndRooms()
.OnComplete(GetLoggedInUserFriendsAndRoomsCallback);
}
Voip.SetMicrophoneFilterCallback(micFilterDelegate);
}
void GetLoggedInUserFriendsAndRoomsCallback(Message<UserAndRoomList> msg)
{
if (msg.IsError)
{
return;
}
foreach (UserAndRoom el in msg.Data)
{
// see if any friends are in a joinable room
if (el.User == null) continue;
if (el.RoomOptional == null) continue;
if (el.RoomOptional.IsMembershipLocked == true) continue;
if (el.RoomOptional.Joinability != RoomJoinability.CanJoin) continue;
if (el.RoomOptional.JoinPolicy == RoomJoinPolicy.None) continue;
SocialPlatformManager.LogOutput("Trying to join room " + el.RoomOptional.ID + ", friend " + el.User.OculusID);
roomManager.JoinExistingRoom(el.RoomOptional.ID);
return;
}
SocialPlatformManager.LogOutput("No friend to join. Creating my own room.");
// didn't find any open rooms, start a new room
roomManager.CreateRoom();
TransitionToState(State.CREATING_A_ROOM);
}
public void OnLocalAvatarPacketRecorded(object sender, OvrAvatar.PacketEventArgs args)
{
var size = Oculus.Avatar.CAPI.ovrAvatarPacket_GetSize(args.Packet.ovrNativePacket);
byte[] toSend = new byte[size];
Oculus.Avatar.CAPI.ovrAvatarPacket_Write(args.Packet.ovrNativePacket, size, toSend);
foreach (KeyValuePair<ulong, RemotePlayer> kvp in remoteUsers)
{
//LogOutputLine("Sending avatar Packet to " + kvp.Key);
p2pManager.SendAvatarUpdate(kvp.Key, this.localAvatar.transform, packetSequence, toSend);
}
packetSequence++;
}
public void OnApplicationQuit()
{
roomManager.LeaveCurrentRoom();
foreach (KeyValuePair<ulong, RemotePlayer> kvp in remoteUsers)
{
p2pManager.Disconnect(kvp.Key);
voipManager.Disconnect(kvp.Key);
}
LogOutputLine("End Log.");
}
public void AddUser(ulong userID, ref RemotePlayer remoteUser)
{
remoteUsers.Add(userID, remoteUser);
}
public void LogOutputLine(string line)
{
Debug.Log(Time.time + ": " + line);
}
// For most errors we terminate the Application since this example doesn't make
// sense if the user is disconnected.
public static void TerminateWithError(Message msg)
{
s_instance.LogOutputLine("Error: " + msg.GetError().Message);
UnityEngine.Application.Quit();
}
#endregion
#region Properties
public static State CurrentState
{
get
{
return s_instance.currentState;
}
}
public static ulong MyID
{
get
{
if (s_instance != null)
{
return s_instance.myID;
}
else
{
return 0;
}
}
}
public static string MyOculusID
{
get
{
if (s_instance != null && s_instance.myOculusID != null)
{
return s_instance.myOculusID;
}
else
{
return string.Empty;
}
}
}
#endregion
#region State Management
public enum State
{
// loading platform library, checking application entitlement,
// getting the local user info
INITIALIZING,
// Checking to see if we were launched from an invite
CHECKING_LAUNCH_STATE,
// Creating a room to join
CREATING_A_ROOM,
// in this state we've create a room, and hopefully
// sent some invites, and we're waiting people to join
WAITING_IN_A_ROOM,
// in this state we're attempting to join a room from an invite
JOINING_A_ROOM,
// we're in a room with others
CONNECTED_IN_A_ROOM,
// Leaving a room
LEAVING_A_ROOM,
// shutdown any connections and leave the current room
SHUTDOWN,
};
public static void TransitionToState(State newState)
{
if (s_instance)
{
s_instance.LogOutputLine("State " + s_instance.currentState + " -> " + newState);
}
if (s_instance && s_instance.currentState != newState)
{
s_instance.currentState = newState;
// state transition logic
switch (newState)
{
case State.SHUTDOWN:
s_instance.OnApplicationQuit();
break;
default:
break;
}
}
SetSphereColorForState();
}
private static void SetSphereColorForState()
{
switch (s_instance.currentState)
{
case State.INITIALIZING:
case State.SHUTDOWN:
s_instance.sphereMesh.material.color = BLACK;
break;
case State.WAITING_IN_A_ROOM:
s_instance.sphereMesh.material.color = WHITE;
break;
case State.CONNECTED_IN_A_ROOM:
s_instance.sphereMesh.material.color = CYAN;
break;
default:
break;
}
}
public static void SetFloorColorForState(bool host)
{
if (host)
{
s_instance.floorMesh.material.color = BLUE;
}
else
{
s_instance.floorMesh.material.color = GREEN;
}
}
public static void MarkAllRemoteUsersAsNotInRoom()
{
foreach (KeyValuePair<ulong, RemotePlayer> kvp in s_instance.remoteUsers)
{
kvp.Value.stillInRoom = false;
}
}
public static void MarkRemoteUserInRoom(ulong userID)
{
RemotePlayer remoteUser = new RemotePlayer();
if (s_instance.remoteUsers.TryGetValue(userID, out remoteUser))
{
remoteUser.stillInRoom = true;
}
}
public static void ForgetRemoteUsersNotInRoom()
{
List<ulong> toPurge = new List<ulong>();
foreach (KeyValuePair<ulong, RemotePlayer> kvp in s_instance.remoteUsers)
{
if (kvp.Value.stillInRoom == false)
{
toPurge.Add(kvp.Key);
}
}
foreach (ulong key in toPurge)
{
RemoveRemoteUser(key);
}
}
public static void LogOutput(string line)
{
s_instance.LogOutputLine(Time.time + ": " + line);
}
public static bool IsUserInRoom(ulong userID)
{
return s_instance.remoteUsers.ContainsKey(userID);
}
public static void AddRemoteUser(ulong userID)
{
RemotePlayer remoteUser = new RemotePlayer();
remoteUser.RemoteAvatar = Instantiate(s_instance.remoteAvatarPrefab);
remoteUser.RemoteAvatar.oculusUserID = userID.ToString();
remoteUser.RemoteAvatar.ShowThirdPerson = true;
remoteUser.RemoteAvatar.EnableMouthVertexAnimation = true;
remoteUser.p2pConnectionState = PeerConnectionState.Unknown;
remoteUser.voipConnectionState = PeerConnectionState.Unknown;
remoteUser.stillInRoom = true;
remoteUser.remoteUserID = userID;
s_instance.AddUser(userID, ref remoteUser);
s_instance.p2pManager.ConnectTo(userID);
s_instance.voipManager.ConnectTo(userID);
remoteUser.voipSource = remoteUser.RemoteAvatar.gameObject.AddComponent<VoipAudioSourceHiLevel>();
remoteUser.voipSource.senderID = userID;
s_instance.LogOutputLine("Adding User " + userID);
}
public static void RemoveRemoteUser(ulong userID)
{
RemotePlayer remoteUser = new RemotePlayer();
if (s_instance.remoteUsers.TryGetValue(userID, out remoteUser))
{
Destroy(remoteUser.RemoteAvatar.GetComponent<VoipAudioSourceHiLevel>(), 0);
Destroy(remoteUser.RemoteAvatar.gameObject, 0);
s_instance.remoteUsers.Remove(userID);
s_instance.LogOutputLine("Removing User " + userID);
}
}
public void UpdateVoiceData(short[] pcmData)
{
float voiceMax = 0.0f;
float[] floats = new float[pcmData.Length];
for (int n = 0; n < pcmData.Length; n++)
{
float cur = floats[n] = (float)pcmData[n] / (float)short.MaxValue;
if (cur > voiceMax)
{
voiceMax = cur;
}
}
voiceCurrent = voiceMax;
}
public static void MicFilter(short[] pcmData, System.UIntPtr pcmDataLength, int frequency, int numChannels)
{
s_instance.UpdateVoiceData(pcmData);
}
public static RemotePlayer GetRemoteUser(ulong userID)
{
RemotePlayer remoteUser = new RemotePlayer();
if (s_instance.remoteUsers.TryGetValue(userID, out remoteUser))
{
return remoteUser;
}
else
{
return null;
}
}
#endregion
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 61a76ada1a1960647bf44fc08c5d5743
timeCreated: 1536104814
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,72 @@
using UnityEngine;
using System.Collections;
using Oculus.Platform;
using Oculus.Platform.Models;
// Helper class to manage the Voice-over-IP connection to the
// remote users
public class VoipManager
{
public VoipManager()
{
Voip.SetVoipConnectRequestCallback(VoipConnectRequestCallback);
Voip.SetVoipStateChangeCallback(VoipStateChangedCallback);
}
public void ConnectTo(ulong userID)
{
// ID comparison is used to decide who initiates and who gets the Callback
if (SocialPlatformManager.MyID < userID)
{
Voip.Start(userID);
SocialPlatformManager.LogOutput("Voip connect to " + userID);
}
}
public void Disconnect(ulong userID)
{
if (userID != 0)
{
Voip.Stop(userID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(userID);
if (remote != null)
{
remote.voipConnectionState = PeerConnectionState.Unknown;
}
}
}
void VoipConnectRequestCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("Voip request from " + msg.Data.ID);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
SocialPlatformManager.LogOutput("Voip request accepted from " + msg.Data.ID);
Voip.Accept(msg.Data.ID);
}
}
void VoipStateChangedCallback(Message<NetworkingPeer> msg)
{
SocialPlatformManager.LogOutput("Voip state to " + msg.Data.ID + " changed to " + msg.Data.State);
RemotePlayer remote = SocialPlatformManager.GetRemoteUser(msg.Data.ID);
if (remote != null)
{
remote.voipConnectionState = msg.Data.State;
// ID comparison is used to decide who initiates and who gets the Callback
if (msg.Data.State == PeerConnectionState.Timeout && SocialPlatformManager.MyID < msg.Data.ID)
{
// keep trying until hangup!
Voip.Start(msg.Data.ID);
SocialPlatformManager.LogOutput("Voip re-connect to " + msg.Data.ID);
}
}
}
}

View File

@@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: d22b9da5532b0224f82207825f9f6a65
timeCreated: 1521151723
licenseType: Store
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: fc164fe2aad000b40a6f426b477793aa
folderAsset: yes
timeCreated: 1496779994
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,58 @@
fileFormatVersion: 2
guid: 0453138effcc80349b11371805f72f5b
timeCreated: 1497548991
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -0,0 +1,58 @@
fileFormatVersion: 2
guid: c8f5462cc092d0c40ad71773132863e0
timeCreated: 1496780052
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,29 @@
The SocialStarter sample is meant to show how to leverage the Oculus Avatars and Oculus platform features together to make a very basic networked social experience.
Steps to run the sample:
1. Import the Oculus Unity Utilities Package if you don't already have it included in your project. This will provide you with all of the necessary general Oculus Prefabs.
2. Import the Oculus Avatar SDK Unity Package if you don't already have it included in your project. This will provide you with all of the necessary Avatar Prefabs.
3. Import the Oculus Platform SDK Unity Package if you don't already have it included in your project. This will provide all of the C# interfaces to the Oculus Platform features.
4. In the Unity editor menus select "Oculus Avatars > Edit Configuration". Place your AppID in the two fields for Rift AppID and Gear AppID.
5. In the Unity editor menus select "Oculus Platform > Edit Settings". Place your AppID in the two fields for Rift AppID and Gear AppID.
6. Make sure the prefabs are set correctly. Select the OVRPlayerController object in the MainScene:
a) Local Avatar Prefab should be set to the "LocalAvatar (OvrAvatar)" prefab found in the Avatar SDK under "OvrAvatar > Content > Prefabs".
b) Remote Avatar Prefab should be set to the "RemoteAvatar (OvrAvatar)" prefab found in the Avatar SDK under "OvrAvatar > Content > Prefabs".
How to use
1. When you first start up the sample you are placed in both a virtual room and an online room. In the virtual room the colour of both the floor and the sphere in the middle are used as state indicators:
a) The sphere colour indicates if you are successfully in an online room. Black means the room creation/join failed for some reason, White means you are in an online room.
b) The floor colour is blue if you are the owner of the room or green if you are just a member of the room.
2. Your left hand should be holding the instructions UI:
Button X: Send an Invite - This will bring up the Oculus Universal Menu which will show a list of your friends that you can invite. This may take a second or two to pop up.
Button Y: Toggle the sky camera - This allows you to view the scene from a static 3rd person camera.
Click left Stick: Toggle showing the instructions UI
Left Stick Analog: Move around the space
Right Stick Analog: Rotate
3. When a user joins your room a VoIP connection and a P2P connection will be setup. The P2P connection is used to send Avatar updates as well as positional updates.

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a7a78d98ba50c73429cf004f1635d521
timeCreated: 1517510514
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant: