Init Config

This commit is contained in:
Jlim 2021-11-18 01:46:14 -05:00
parent 9eb462dcab
commit 2ead1c9ca5
1633 changed files with 275438 additions and 2396 deletions

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: bf449f9900e31488980ab02b943a91e4
guid: b3405f85171d5d049b1e88d877bf5e5f
folderAsset: yes
timeCreated: 1440740277
timeCreated: 1497495803
licenseType: Free
DefaultImporter:
userData:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b6a969af62f8456459fc3e229ad329bc
folderAsset: yes
timeCreated: 1459944434
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: blueCylinder
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0, g: 0.0068967342, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5e705d781b477d141a4ea1470438be7f
timeCreated: 1459944515
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: greenCube
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0, g: 1, b: 0.17241383, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e2a3121ba16987641b46655eaef86c88
timeCreated: 1459944518
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: gridFloor
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 10, y: 10}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 182fa9c20991bb64a873c30c3170549b, type: 3}
m_Scale: {x: 10, y: 10}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 00bbd658d0d73dd47a85c34c84b50ba3
timeCreated: 1440516334
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: purpleCapsule
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 0.51799965, g: 0, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 858e823dd3f9a15449ea6ea43ffec1b3
timeCreated: 1459944522
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,73 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: redSphere
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _Glossiness: 0.5
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 0, b: 0, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e33b59c060202e141b5d39e528998633
timeCreated: 1459944499
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +1,6 @@
fileFormatVersion: 2
guid: 175018180ed414521b0d47d393f347df
timeCreated: 1440740277
licenseType: Free
guid: 7ccf0e1125c4a66448d95c5a15e3eb3b
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:

Binary file not shown.

View File

@ -0,0 +1,24 @@
fileFormatVersion: 2
guid: e8acc2fe1ea3bc5458b296c0d1eb5358
timeCreated: 1497453920
licenseType: Pro
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 1
settings: {}
Editor:
enabled: 0
settings:
DefaultValueInitialized: true
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,20 @@
fileFormatVersion: 2
guid: 6869f97e2f1fc2143a9c5104606b6e08
timeCreated: 1497495852
licenseType: Free
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Any:
enabled: 1
settings: {}
Editor:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 82e3be018a2c848249d81909ca06aecb
guid: 8054d5b0c4bf9a747b9d738ea1bde351
folderAsset: yes
timeCreated: 1440740276
timeCreated: 1471850818
licenseType: Free
DefaultImporter:
userData:

Binary file not shown.

View File

@ -1,7 +1,6 @@
fileFormatVersion: 2
guid: f735e311710bf4dff9c88fc40dde6fc8
folderAsset: yes
timeCreated: 1440740276
guid: 51699a7f907ffe242ab4810b57255919
timeCreated: 1498441537
licenseType: Free
PluginImporter:
serializedVersion: 1
@ -9,60 +8,46 @@ PluginImporter:
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 1
settings: {}
Editor:
enabled: 0
settings:
CPU: AnyCPU
CPU: x86_64
DefaultValueInitialized: true
OS: OSX
Linux:
enabled: 0
settings:
CPU: x86
CPU: None
Linux64:
enabled: 0
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
enabled: 1
settings:
CPU: x86_64
OSXIntel:
enabled: 0
settings:
CPU: None
OSXIntel:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel64:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
enabled: 0
settings:
STV_MODEL: STANDARD_13
CPU: x86_64
Win:
enabled: 0
settings:
CPU: AnyCPU
CPU: None
Win64:
enabled: 0
enabled: 1
settings:
CPU: AnyCPU
iOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: d7c8bf2044313a84f882df158a95783d
folderAsset: yes
timeCreated: 1440515699
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,584 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1000010745827638
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000011615638566}
m_Layer: 8
m_Name: ForwardIndicator
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000011615638566
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000010745827638}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0, y: 0.6300001, z: 0}
m_LocalScale: {x: 0.19953951, y: 0.21250719, z: 2.0859916}
m_Children:
- {fileID: 4000012198888954}
m_Father: {fileID: 4000012232001114}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1000011639520514
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000012232001114}
- component: {fileID: 54000010204227658}
- component: {fileID: 143000013197982616}
- component: {fileID: 114000010963845762}
- component: {fileID: 114000011486231928}
m_Layer: 8
m_Name: OmniCharacterController
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000012232001114
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000011639520514}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4000011615638566}
- {fileID: 4000011314157346}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!54 &54000010204227658
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000011639520514}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!143 &143000013197982616
CharacterController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000011639520514}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Height: 1.8
m_Radius: 0.5
m_SlopeLimit: 45
m_StepOffset: 0.3
m_SkinWidth: 0.08
m_MinMoveDistance: 0
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &114000010963845762
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000011639520514}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b4816de52c8590048a0c0dc7a647cbb2, type: 3}
m_Name:
m_EditorClassIdentifier:
maxSpeed: 7
strafeSpeedMultiplier: 1
backwardsSpeedMultiplier: 0.4
gravityMultiplier: 0.8
couplingPercentage: 1
developerMode: 0
hidInput: {x: 0, y: 0}
currentOmniYaw: 0
currentStepCount: 0
omniOffset: 0
angleBetweenOmniAndCamera: 0
omniFound: 0
cameraReference: {fileID: 4000011557633224}
dummyObject: {fileID: 4000011615638566}
--- !u!114 &114000011486231928
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000011639520514}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ee798ae13c81b874cb4936d55d659261, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1000012324955648
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 224000011204668234}
- component: {fileID: 222000011434523264}
- component: {fileID: 114000012136671418}
- component: {fileID: 114000010731870442}
- component: {fileID: 114000013573299552}
m_Layer: 5
m_Name: DebugText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &224000011204668234
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012324955648}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -2.81}
m_LocalScale: {x: 0.01, y: 0.01, z: 0.01}
m_Children: []
m_Father: {fileID: 224000010932287464}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1000, y: 500}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &222000011434523264
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012324955648}
m_CullTransparentMesh: 0
--- !u!114 &114000012136671418
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012324955648}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 50
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 50
m_Alignment: 3
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Omni X: 1.0000
Omni Y: 1.0000
Omni Yaw: 500
Step Count:
13249225902
Calibrated: '
--- !u!114 &114000010731870442
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012324955648}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0.44117647, g: 0.44117647, b: 0.44117647, a: 0.5}
m_EffectDistance: {x: 2, y: 2}
m_UseGraphicAlpha: 1
--- !u!114 &114000013573299552
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012324955648}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cfabb0440166ab443bba8876756fdfa9, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 0, g: 0, b: 0, a: 0.5}
m_EffectDistance: {x: 4, y: -2}
m_UseGraphicAlpha: 1
--- !u!1 &1000012517200622
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 224000010932287464}
- component: {fileID: 223000013945533854}
- component: {fileID: 114000013872908850}
- component: {fileID: 114000012183324438}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &224000010932287464
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012517200622}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 12.04}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224000011204668234}
m_Father: {fileID: 4000013786469220}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 394, y: 477}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!223 &223000013945533854
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012517200622}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 2
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!114 &114000013872908850
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012517200622}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 1
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &114000012183324438
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000012517200622}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!1 &1000013325373224
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000011557633224}
- component: {fileID: 81000012959633612}
- component: {fileID: 20000012786038030}
m_Layer: 8
m_Name: VR_Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000011557633224
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013325373224}
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: 4000013786469220}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!81 &81000012959633612
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013325373224}
m_Enabled: 1
--- !u!20 &20000012786038030
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013325373224}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.01
far clip plane: 400
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!1 &1000013436857316
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000013786469220}
m_Layer: 8
m_Name: CameraSetupRootOffset
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000013786469220
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013436857316}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 4000011557633224}
- {fileID: 224000010932287464}
m_Father: {fileID: 4000011314157346}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1000013635456490
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000012198888954}
- component: {fileID: 33000014041854182}
- component: {fileID: 23000011279980360}
m_Layer: 8
m_Name: Debug_ForwardIndicator
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &4000012198888954
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013635456490}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -2, z: 0.5}
m_LocalScale: {x: 0.25, y: 0.25, z: 1}
m_Children: []
m_Father: {fileID: 4000011615638566}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &33000014041854182
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013635456490}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &23000011279980360
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013635456490}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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!1 &1000013858168224
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4000011314157346}
m_Layer: 8
m_Name: CameraSetupParent
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4000011314157346
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1000013858168224}
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:
- {fileID: 4000013786469220}
m_Father: {fileID: 4000012232001114}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 88c212ff2c682b548944fc43c2a387fb
timeCreated: 1498686736
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f2250f03c44e28c4a8f9cbeb44a6185f
folderAsset: yes
timeCreated: 1440516319
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,760 @@
%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: 9
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, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &4
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 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: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 0
--- !u!196 &5
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 &315928642
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 315928644}
- component: {fileID: 315928643}
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 &315928643
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 315928642}
m_Enabled: 1
serializedVersion: 10
m_Type: 1
m_Shape: 0
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
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_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &315928644
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 315928642}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!1 &413110723
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 413110727}
- component: {fileID: 413110726}
- component: {fileID: 413110725}
- component: {fileID: 413110724}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &413110724
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413110723}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e33b59c060202e141b5d39e528998633, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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 &413110725
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413110723}
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 &413110726
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413110723}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &413110727
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 413110723}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 25, y: 1.5, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children: []
m_Father: {fileID: 2044030308}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &513774998
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 513775002}
- component: {fileID: 513775001}
- component: {fileID: 513775000}
- component: {fileID: 513774999}
m_Layer: 0
m_Name: Capsule
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &513774999
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513774998}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 858e823dd3f9a15449ea6ea43ffec1b3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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!136 &513775000
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513774998}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &513775001
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513774998}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &513775002
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 513774998}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -25, y: 1.5, z: 0}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children: []
m_Father: {fileID: 2044030308}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &736008106
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 736008110}
- component: {fileID: 736008109}
- component: {fileID: 736008108}
- component: {fileID: 736008107}
m_Layer: 0
m_Name: Cylinder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &736008107
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 736008106}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 5e705d781b477d141a4ea1470438be7f, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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!136 &736008108
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 736008106}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &736008109
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 736008106}
m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &736008110
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 736008106}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.5, z: -25}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children: []
m_Father: {fileID: 2044030308}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &858770709
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 858770713}
- component: {fileID: 858770712}
- component: {fileID: 858770711}
- component: {fileID: 858770710}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &858770710
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858770709}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: e2a3121ba16987641b46655eaef86c88, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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!65 &858770711
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858770709}
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 &858770712
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858770709}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &858770713
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 858770709}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.5, z: 25}
m_LocalScale: {x: 3, y: 3, z: 3}
m_Children: []
m_Father: {fileID: 2044030308}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &881048882
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 881048886}
- component: {fileID: 881048885}
- component: {fileID: 881048884}
- component: {fileID: 881048883}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &881048883
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 881048882}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 00bbd658d0d73dd47a85c34c84b50ba3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
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 &881048884
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 881048882}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 4
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &881048885
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 881048882}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &881048886
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 881048882}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 25.83875, y: 25.83874, z: 25.83874}
m_Children: []
m_Father: {fileID: 2044030308}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1796703798
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalPosition.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4000012232001114, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 114000014200475062, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 88c212ff2c682b548944fc43c2a387fb, type: 3}
--- !u!1 &2044030307
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2044030308}
m_Layer: 0
m_Name: GridTestingLevel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2044030308
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2044030307}
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:
- {fileID: 881048886}
- {fileID: 858770713}
- {fileID: 413110727}
- {fileID: 736008110}
- {fileID: 513775002}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

View File

@ -1,7 +1,7 @@
fileFormatVersion: 2
guid: 9f5358b3db23a49fbba414e2930f127e
timeCreated: 1440740277
licenseType: Free
guid: a83044e9aacb91b42adc275b1985ad72
timeCreated: 1459339649
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 76e0760eca614114f92851e09523163e
folderAsset: yes
timeCreated: 1440515560
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,313 @@
using UnityEngine;
using System.Runtime.InteropServices;
using System.IO;
using System;
using UnityEngine.UI;
using UnityEngine.XR;
using System.Xml;
using System.Collections.Generic;
public class OVSDK : MonoBehaviour
{
public static string _SDKVersion = "0.4.0";
public delegate void OVSDKEventCallback(int nMsgType, string sMsgContent);
public delegate void OVSDKBuyCallback(string sItem, string sOutTradeNo, string sInTradeNo, string sErr);
public delegate void OVSDKSaveGameDataCallback(int nError, string sMsg);
public delegate void OVSDKLoadGameDataCallback(int nError, string sMsg, IntPtr data, int len);
static OVSDKEventCallback _DllEventCallback = null;
[StructLayout(LayoutKind.Sequential)]
public struct DeviceInfo
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string sNo; //Omni serial-number;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string sUID; //Omni device UID in Omniverse backend.
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string sShopName; //Shop name
[MarshalAs(UnmanagedType.U4)]
public int nId; //for internal usage
[MarshalAs(UnmanagedType.U4)]
public int nShop; //Shop Id
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string sCategory;//for internal usage
}
[StructLayout(LayoutKind.Sequential)]
public struct UserInfo
{
[MarshalAs(UnmanagedType.U4)]
public int nUserId; //The player's unique account id in Omniverse;
[MarshalAs(UnmanagedType.U4)]
public int nGameId; //GameID from OVSDK::Init
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
string sCookies; //for internal usage
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
public string sGameSDKType; //Omniverse SDK type, "unty": unity-SDK, "ue4x": UE4-SDK;
[MarshalAs(UnmanagedType.U4)]
public int nGameSDKVersion; //Omniverse SDK version, version string 0xAAAA.0xBB.0xCC, format as uint32 0xAAAABBCC;
[MarshalAs(UnmanagedType.U4)]
public int nGamePrepareLeft; //Game-prepare time left, use for single game ticket mode;
[MarshalAs(UnmanagedType.U4)]
public int nGameDurationLeft; //Game-play time left;
[MarshalAs(UnmanagedType.U4)]
public int nGamePrepare; //Game-prepare time, each game can config its own prepare time. The time is used to choose level, match game, but the duration is limited.
//If level or match start, you should call OVSDK.ConfirmPlayGame() to tell SDK countdown game-time now.
[MarshalAs(UnmanagedType.U4)]
public int nGameDuration; //Gameplay time;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string sBillingMode; //Ticket mode, "timing", "timingreal", "direct_game", "shiyu_coin", "game_auth", "timescount";
[MarshalAs(UnmanagedType.U4)]
public int nUserProp; //for internal usage;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string sConsolePath; //for internal usage;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] nCoupleRate; //Omni couple rate data of default
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] nUserCoupleRate; //Omni couple rate setting about user
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 60)]
string sReserved; //for internal usage;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string sQrcode; //The omniverse trade number for this game ticket;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string sWeb2d; //for internal usage;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
public string sReserved2; //for internal usage;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string sUserName; //Player's nick game in Omniverse;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]
public string sUserPhone; //Player's phone number registered in Omniverse; (maybe masked, some character replaced by '*' for privacy)
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string sUserEmail; //Player's email registered in Omniverse; (maybe masked)
public double nUserBalance; //Player's balance in Omniverse; (In-game purchase costs this balance)
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 124)]
public string sUserIcon; //Player's portrait icon url;
[MarshalAs(UnmanagedType.U4)]
public int nDesktopDurationLeft;//for internal usage;
}
// public interface for Game-developer
static bool _bIniting = false, _bInitDone = false, _bJustInitDone = false;
static string _sInitResult;
static int _nInitResultCode = 0;
static OVSDK _Instance = null;
public static OVSDK instance
{
get {
if (null == _Instance)
{
_Instance = GameObject.FindObjectOfType<OVSDK>();
if (null == _Instance)
{
GameObject go = new GameObject("OVSDK_GlobalInstance");
_Instance = go.AddComponent<OVSDK>();
DontDestroyOnLoad(go);
}
}
return _Instance;
}
}
public static void SetCallBackOnMsgFromSDK(OVSDKEventCallback cbHvMsg)
{
_DllEventCallback = cbHvMsg;
}
public static void Init(int nGameId, string sGameKey, string sParam)
{
if (null == OVSDK.instance) {
Debug.LogError("get OVSDK.instance failed.");
}
//if (_bIniting || _bInitDone) {
// Debug.LogError("OVSDK should Init once only.");
//}
_bIniting = true;
_bInitDone = _bJustInitDone = false;
sParam = sParam + ";sdk_type=unty;sdk_version=" + _SDKVersion;
DllInit(nGameId, sGameKey, sParam, onEventFromSDK, IntPtr.Zero);
}
public static bool HasInitialized()
{
return _bInitDone;
}
public static bool JustInitialized()
{
return _bJustInitDone;
}
public static int GetInitResultCode()
{
return _nInitResultCode;
}
public static string GetInitResult()
{
return _sInitResult;
}
public static DeviceInfo GetDeviceInfo()
{
DeviceInfo info = (DeviceInfo)Marshal.PtrToStructure(DllGetDeviceInfo(), typeof(DeviceInfo)); ;
return info;
}
public static UserInfo GetUserInfo()
{
UserInfo info = (UserInfo)Marshal.PtrToStructure(DllGetUserInfo(), typeof(UserInfo));
return info;
}
public static bool IsGuest()
{
return DllIsGuest();
}
private static void onEventFromSDK(IntPtr sType, int nRetCode, IntPtr sRet, int nLen, IntPtr pUserData)
{
//string type = bytesToString(sType);
string type = Marshal.PtrToStringAnsi(sType);
string ret = "";
//ret = bytesToString(sRet, nLen);
ret = Marshal.PtrToStringAnsi(sRet, nLen);
Debug.Log("OVSDK.OnEventFromSDK(" + type + ", " + nRetCode + ",\n" + ret + ")");
if (type == "init")
{
_bInitDone = true;
_sInitResult = ret;
_nInitResultCode = nRetCode;
}
}
public static float GetOmniYawOffset()
{
return DllGetOmniYawOffset();
}
public static float GetOmniCoupleRate()
{
return DllGetOmniCoupleRate();
}
public static UInt32 GetUserOmniCoupleRate()
{
return DllGetUserOmniCoupleRate();
}
public static void SetOmniCoupleRate(float rate)
{
DllSetOmniCoupleRate(rate);
}
public static void SetOmniCoupleMode(bool useCoupleMode)
{
DllSetOmniCoupleMode(useCoupleMode);
}
//----------------------------------------------------------------------------------------------------------------------------------
// Omniverse.Functions.dll functions.
delegate void DllCallback(IntPtr sType, int nRetCode, IntPtr sRet, int nLen, IntPtr pUserData);
[DllImport("Omniverse.Functions")]
static extern bool DllInit(int nGameId, string sGameKey, string sParam, DllCallback cb, IntPtr pUserData);
[DllImport("Omniverse.Functions")]
static extern void DllShutdown();
[DllImport("Omniverse.Functions")]
public static extern bool DllLaunchGame(string exe, string workdir, string cmdline, int game_id, int prepare_time); //启动游戏,传入参数
[DllImport("Omniverse.Functions")]
static extern bool DllIsDevMode();
[DllImport("Omniverse.Functions")]
static extern void DllDrive();
[DllImport("Omniverse.Functions")]
static extern void DllSendCommand(int nCmd, string sData, int nLen);
[DllImport("Omniverse.Functions")]
static extern void DllBuy(string sItem, double nPrice, string sOutTradeNo);
[DllImport("Omniverse.Functions")]
static extern IntPtr DllGetDeviceInfo();
[DllImport("Omniverse.Functions")]
static extern IntPtr DllGetUserInfo();
[DllImport("Omniverse.Functions")]
static extern float DllGetOmniYawOffset();
[DllImport("Omniverse.Functions")]
static extern float DllGetOmniCoupleRate();
[DllImport("Omniverse.Functions")]
static extern UInt32 DllGetUserOmniCoupleRate();
[DllImport("Omniverse.Functions")]
static extern void DllSetOmniCoupleRate(float coupleRate);
[DllImport("Omniverse.Functions")]
static extern void DllSetOmniCoupleMode(bool useCoupleMode);
[DllImport("Omniverse.Functions")]
static extern bool DllIsGuest();
[DllImport("Omniverse.Functions")]
static extern void DllSaveGameData(IntPtr data, int len);
[DllImport("Omniverse.Functions")]
static extern void DllLoadGameData();
[DllImport("Omniverse.Functions")]
public static extern void DllTest(IntPtr param);
#if UNITY_EDITOR
[DllImport("User32.dll", SetLastError = true, ThrowOnUnmappableChar = true, CharSet = CharSet.Auto)]
public static extern int MessageBox(IntPtr handle, String message, String title, int type);
#endif
//----------------------------------------------------------------------------------------------------------------------------------
// internal utility functions.
void Start()
{
}
void Update()
{
DllDrive();
if (_bInitDone)
{
if (_bIniting)
{
_bIniting = false;
_bJustInitDone = true;
}
else if (_bJustInitDone)
{
_bJustInitDone = false;
}
}
}
void OnDestroy()
{
Debug.Log("OVSDK shutdown.");
DllShutdown();
}
}

View File

@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 36c08f14028ff5d499d8408db9ea95a6
timeCreated: 1506536874
guid: 1d235f39aecf8444699ab31ef3bdf0f6
timeCreated: 1479458500
licenseType: Free
MonoImporter:
serializedVersion: 2

View File

@ -0,0 +1,54 @@
using UnityEngine;
using System.Collections;
using System;
using System.Text;
using UnityEngine.Networking;
public class OmniConnectWebRequest : MonoBehaviour
{
public static IEnumerator CoroutinePostRequest(string url, byte[] postRequest, System.Action<string> result)
{
using (UnityWebRequest web = UnityWebRequest.Post(url, postRequest.ToString()))
{
yield return web.SendWebRequest();
if (web.isNetworkError || web.isHttpError)
{
Debug.LogError("OmniSDK: OmniConnectWebRequest failed post request at " + url + ": " + web.error + ". Ensure that Omni Connect is installed and running on your system.");
result("Error");
}
else
{
Debug.Log("OmniSDK: SetOmniConnectGamepadMode Post Request Successful at " + url + web.downloadHandler.text);
result(web.downloadHandler.text);
}
}
}
public static IEnumerator CoroutineGetRequest(string url, System.Action<string> result)
{
using (UnityWebRequest web = UnityWebRequest.Get(url))
{
yield return web.SendWebRequest();
if (web.isNetworkError || web.isHttpError)
{
Debug.LogError("OmniSDK: OmniConnectWebRequest failed get request at " + url + ": " + web.error + ". Ensure that Omni Connect is installed and running on your system.");
result("Error");
}
else
{
Debug.Log("OmniSDK: OmniConnectWebRequest successful get request at " + url + ": " + web.downloadHandler.text);
result(web.downloadHandler.text);
}
}
}
}
[Serializable]
public class OmniConnectMode
{
public string Data;
}

View File

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

View File

@ -0,0 +1,78 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine.XR;
using UnityEngine;
/*
To add Omni Movement to an existing Character, follow the steps outlined below:
1. Add the OmniMovementComponent Script to your Character.
2. Inside of your Character Controller Script, create an OmniMovementComponent variable and get the Reference to the Component on Start().
3. Copy the UseOmniInputToMovePlayer() function to your Character Controller Script.
4. Call the UseOmniInputToMovePlayer() function in your Character Controller Script's Update() function.
*/
public class OmniController_Example : MonoBehaviour {
protected OmniMovementComponent MovementComponent;
private CharacterController m_CharacterController;
private Camera cameraRef;
private bool RotationCorrected = false;
// Use this for initialization
void Start ()
{
MovementComponent = GetComponent<OmniMovementComponent>();
m_CharacterController = GetComponent<CharacterController>();
}
void CorrectSpawnForward()
{
RotationCorrected = true;
Vector3 resultRotation = new Vector3(0.0f, 0.0f, 0.0f);
Vector3 spawnRotation = transform.rotation.eulerAngles;
cameraRef = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<Camera>();
Vector3 cameraRotation = cameraRef.transform.rotation.eulerAngles;
float spawnRotationYaw = spawnRotation.y;
float cameraYaw = cameraRotation.y;
float difference = spawnRotationYaw - cameraYaw;
resultRotation.y = difference;
transform.Rotate(resultRotation);
}
// Update is called once per frame
void Update ()
{
if(!RotationCorrected)
{
if(OmniService.isPresent())
CorrectSpawnForward();
}
UseOmniInputToMovePlayer();
}
// Gets Omni Movement Vectors from the OmniMovementComponent and uses them to Move the Player
void UseOmniInputToMovePlayer()
{
if (MovementComponent.omniFound)
MovementComponent.GetOmniInputForCharacterMovement();
else if (MovementComponent.developerMode)
MovementComponent.DeveloperModeUpdate();
if (MovementComponent.GetForwardMovement() != Vector3.zero)
m_CharacterController.Move(MovementComponent.GetForwardMovement());
if (MovementComponent.GetStrafeMovement() != Vector3.zero)
m_CharacterController.Move(MovementComponent.GetStrafeMovement());
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ee798ae13c81b874cb4936d55d659261
timeCreated: 1497453778
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: cac0759786232554cac3c973b7959993
folderAsset: yes
timeCreated: 1456163166
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -4,8 +4,8 @@ using System.Collections;
using System;
using System.Text;
public class HIDapi {
public class HIDapi
{
[DllImport("hidapi")]
public static extern int hid_init();
@ -62,7 +62,8 @@ public class HIDapi {
public static extern int hid_write(IntPtr device, byte[] data, UIntPtr length);
}
struct hid_device_info {
struct hid_device_info
{
public string path;
public ushort vendor_id;
public ushort product_id;
@ -74,4 +75,20 @@ struct hid_device_info {
public ushort usage;
public int interface_number;
public IntPtr next;
}
hid_device_info(int param = 0)
{
path = "";
vendor_id = 0;
product_id = 0;
serial_number = "";
release_number = 0;
manufacturer_string = "";
product_string = "";
usage_page = 0;
usage = 0;
interface_number = 0;
next = IntPtr.Zero;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9867044fda4595044a0e8a7aa0c52dce
timeCreated: 1497453805
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,109 @@
using UnityEngine;
using System.Collections.Generic;
using System;
using System.Runtime.InteropServices;
public class OmniManager
{
private const ushort vendor_id_omni = 0x29eb;
private const ushort product_id_omni = 0x00ff;
private IntPtr hidapi_handle;
private byte[] inputBuf = new byte[65];
private byte[] outputBuf = new byte[65];
public bool omniDisconnected = true;
public bool FindOmni()
{
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniManager(FindOmni) - Trying to find the Omni");
ushort vendor = 0;
ushort product = 0;
vendor = vendor_id_omni;
product = product_id_omni;
IntPtr ptr = HIDapi.hid_enumerate(vendor, product);
IntPtr cur_ptr = ptr;
if (ptr == IntPtr.Zero)
return false;
hid_device_info enumerate = (hid_device_info)Marshal.PtrToStructure(ptr, typeof(hid_device_info));
bool found = false;
while (cur_ptr != IntPtr.Zero)
{
IntPtr handle = HIDapi.hid_open_path(enumerate.path);
if (enumerate.path.Contains("mi_04"))
{
hidapi_handle = handle;
HIDapi.hid_set_nonblocking(hidapi_handle, 1);
found = true;
omniDisconnected = false;
break;
}
if (enumerate.path.Contains("mi_00"))
{
hidapi_handle = handle;
HIDapi.hid_set_nonblocking(hidapi_handle, 1);
found = true;
omniDisconnected = false;
break;
}
cur_ptr = enumerate.next;
if (cur_ptr != IntPtr.Zero)
enumerate = (hid_device_info)Marshal.PtrToStructure(cur_ptr, typeof(hid_device_info));
}
HIDapi.hid_free_enumeration(ptr);
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniManager(FindOmni) - Result of trying to find the Omni = " + found);
return found;
}
public void Cleanup()
{
if (hidapi_handle != IntPtr.Zero)
{
HIDapi.hid_close(hidapi_handle);
hidapi_handle = IntPtr.Zero;
}
}
public int ReadData(ref byte[] packet)
{
if (omniDisconnected) //if disconnected, don't do anything
return -2;
if (hidapi_handle == IntPtr.Zero) return -2;
Array.Clear(inputBuf, 0, 65);
HIDapi.hid_read(hidapi_handle, inputBuf, new UIntPtr(Convert.ToUInt32(inputBuf.Length)));
if(inputBuf[0] != 0xEF) //Checking for invalid message
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniManager(ReadData) - The Omni has been diconnected and is no longer being detected.");
omniDisconnected = true;
Cleanup();
}
if (inputBuf[2] == 169) // hex A9
{
packet = new byte[inputBuf[1]];
Buffer.BlockCopy(inputBuf, 0, packet, 0, inputBuf[1]);
} else
{
return -2; //pods off or write data
}
return inputBuf[1];
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 136ac4fbc36a85d49af1ed135034593d
timeCreated: 1497453805
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,51 @@
using UnityEngine;
using Microsoft.Win32;
using System;
using System.Collections;
public class OmniMovementCalibration : MonoBehaviour {
public static float GetCalibrationValue()
{
float consumerCalibrationValue;
RegistryKey calibrationKey = Registry.CurrentUser.OpenSubKey(@"Software\HeroVR\SDK\OmniYawOffset", false);
if (calibrationKey == null)
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniMovementCalibration(GetCalibrationValue) - You need to calibrate your Omni using the external calibration application");
consumerCalibrationValue = 0.0f;
}
else
{
consumerCalibrationValue = Convert.ToSingle(calibrationKey.GetValue(""));
calibrationKey.Close();
}
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementCalibration(GetCalibrationValue) - Calibration Value = " + consumerCalibrationValue);
return consumerCalibrationValue;
}
public static float GetCouplingPercentage()
{
float consumerCouplingPercentageValue;
RegistryKey couplingPercentageKey = Registry.CurrentUser.OpenSubKey(@"Software\HeroVR\SDK\CouplingPercentage", false);
if (couplingPercentageKey == null)
{
RegistryKey newKey;
newKey = Registry.CurrentUser.CreateSubKey(@"Software\HeroVR\SDK\CouplingPercentage");
newKey.SetValue("", 1.0f);
consumerCouplingPercentageValue = 1.0f;
newKey.Close();
}
else
{
consumerCouplingPercentageValue = Convert.ToSingle(couplingPercentageKey.GetValue(""));
couplingPercentageKey.Close();
}
//Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementCalibration(GetCouplingPercentage) - Coupling Percentage = " + consumerCouplingPercentageValue);
return consumerCouplingPercentageValue;
}
}

View File

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

View File

@ -0,0 +1,699 @@
using UnityEngine;
using System;
using System.IO;
using System.Threading;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine.XR;
using UnityEngine.UI;
using System.Collections;
public delegate IntPtr WndProcDelegate(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam);
public class OmniMovementComponent : MonoBehaviour {
[Header("-----Movement Options-----")]
[Tooltip("Affects overall speed forward, back, left, right.")]
public float maxSpeed = 10;
[Range(0.0f, 1.0f)]
[Tooltip("Multiplier to reduce strafing speed (Strafing at full speed can feel too fast).")]
public float strafeSpeedMultiplier = 1.0f;
[Range(0.0f, 1.0f)]
[Tooltip("Multiplier to reduce backwards speed (Moving backwards at full speed can feel too fast).")]
public float backwardsSpeedMultiplier = 1.0f;
[Tooltip("Multiplier for gravity for character controller.")]
public float gravityMultiplier = 1;
[HideInInspector]
[Range(0.0f, 1.0f)]
[Tooltip("Fully coupled to camera = 100%, Fully decoupled (follows torso/ring angle = 0%.")]
public float couplingPercentage = 1.0f;
[Tooltip("Set to True if you want to use a joystick or WASD for testing instead of the Omni and no HMD. Please uncheck when you do a full build for release.")]
public bool developerMode = false;
[Header("Output and Calculated Variables. Can be used to debug or poll during game.")]
[HideInInspector]
public Vector2 hidInput; // holds x and y values for movement from the controller
[HideInInspector]
public float currentOmniYaw;
[HideInInspector]
public int currentStepCount;
[HideInInspector]
public float omniOffset = 0f;
[HideInInspector]
public float angleBetweenOmniAndCamera;
//Has the Omni been found
[HideInInspector]
public bool omniFound = false;
[Header("-----GameObject References-----")]
public Transform cameraReference;
public Transform dummyObject;
protected Vector3 dummyForward;
protected CharacterController characterController;
protected bool hasCalibrated = false;
protected int startingStepCount;
protected bool hasSetCouplingPercentage = false;
protected OmniManager omniManager;
private const int SOP = (int)OmniCommon.packet_start_end.OMNI_SOP;
private const int EOP = (int)OmniCommon.packet_start_end.OMNI_EOP;
/* Disable unused variable warnings */
#pragma warning disable 0414
protected static OmniCommon.Messages.OmniRawData rawData;
protected static OmniCommon.Messages.OmniMotionData motionData;
#pragma warning restore 0414
protected byte rawX = 0;
protected byte rawY = 0;
protected float omniX = 0;
protected float omniY = 0;
protected bool hasFullyInitialized = false;
//private int debugCounterForDataMessages = 0;
private bool debugNotReceivingData = false;
private bool hasReceivedOmniData = false;
private float joystickDeadzone = 0.05f;
private Vector3 forwardMovement;
private Vector3 strafeMovement;
private enum SecureAuthenticationProtocolState { SAPEnabled, SAPDisabled, SAPError };
private SecureAuthenticationProtocolState mySAPStatus = SecureAuthenticationProtocolState.SAPError;
private int SAPErrorChecks = 0;
#region reconnecting logic
IntPtr hMainWindow;
IntPtr oldWndProcPtr;
IntPtr newWndProcPtr;
WndProcDelegate newWndProc;
bool isrunning = false;
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern System.IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
static extern IntPtr SetWindowLongPtr(IntPtr hWnd, int nIndex, IntPtr dwNewLong);
[DllImport("user32.dll")]
static extern IntPtr CallWindowProc(IntPtr lpPrevWndFunc, IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
IntPtr wndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
if (msg == 0x0219)
{
//Debug.LogError("Event Triggered; " + wParam.ToInt32());// + "; " + lParam.ToInt32());
switch (wParam.ToInt32())
{
case 0x8000: // DBT_DEVICEARRIVAL
//case 0x8004: // DBT_DEVICEREMOVECOMPLETE
//case 0x0007: // DBT_DEVNODES_CHANGED:
AttemptToReconnectTheOmni();
break;
}
}
return CallWindowProc(oldWndProcPtr, hWnd, msg, wParam, lParam);
}
#endregion
void Start()
{
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent- Omni/SecureOmni SDK Version 2.3");
if (!Application.isEditor)
{
developerMode = false;
}
OmniInitialize();
Start_TryingtoReconnect();
}
void Start_TryingtoReconnect()
{
if (isrunning) return;
hMainWindow = GetForegroundWindow();
newWndProc = new WndProcDelegate(wndProc);
newWndProcPtr = Marshal.GetFunctionPointerForDelegate(newWndProc);
oldWndProcPtr = SetWindowLongPtr(hMainWindow, -4, newWndProcPtr);
isrunning = true;
}
private IEnumerator ConfigureOmniConnect()
{
yield return new WaitForSeconds(3f);
StartCoroutine(SetGameMode());
SAPErrorChecks = 0;
mySAPStatus = SecureAuthenticationProtocolState.SAPError;
StartCoroutine(VerifySAP());
yield return new WaitForSeconds(10f);
string systemReadyCheckUrl = "http://localhost:8085/systemReady";
string systemReadyWebResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutineGetRequest(systemReadyCheckUrl, value => systemReadyWebResponse = value));
if (systemReadyWebResponse.Contains("OK;Secure;MotionDisabled"))
{
Debug.LogError("Authentication Protocol Failed. Your Omni is not registered and therefore cannot be enabled. Please contact your Omni provider to register your Omni.");
}
}
private IEnumerator VerifySAP()
{
SecureAuthenticationProtocolState SAPGetResponse = SecureAuthenticationProtocolState.SAPError;
yield return StartCoroutine(GetSecureAuthentication(value => SAPGetResponse = value));
mySAPStatus = SAPGetResponse;
if (mySAPStatus == SecureAuthenticationProtocolState.SAPEnabled)
{
Debug.Log("SAP Enabled. Initializing SDK.");
/* For Initialization to work, you must create a developer account, and register your game with Virtuix by
* emailing your Omni provider. Please provide the serial number for any Omnis that you wish to use for development.*/
OVSDK.Init(1000, "01ec17dac7140c0fbe936ee128310000", "omni=1");
hasSetCouplingPercentage = false;
}
else if (mySAPStatus == SecureAuthenticationProtocolState.SAPDisabled)
{
Debug.Log("SAP Disabled.");
hasSetCouplingPercentage = false;
}
else
{
if (SAPErrorChecks < 3)
{
SAPErrorChecks++;
yield return new WaitForSeconds(2f);
StartCoroutine(VerifySAP());
}
else
{
Debug.LogError("There is an error with your configuration in Omni Connect. Ensure that Omni Connect is installed and running on your system. " +
"Verify that it is updated to the latest version and that the PODs are connected and on.");
}
}
}
private IEnumerator SetGameMode()
{
//Check the Game Mode to see if it is already set to "Gamepad"
string coroutineUrl = "http://localhost:8085/gamemode";
string GameModeGetResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutineGetRequest(coroutineUrl, value => GameModeGetResponse = value));
//Set Game mode to "Gamepad" if it is not already.
if (!GameModeGetResponse.Contains("Gamepad") && GameModeGetResponse != "Error")
{
OmniConnectMode omniConnectMode = new OmniConnectMode
{
Data = "Gamepad"
};
string json = JsonUtility.ToJson(omniConnectMode);
byte[] pData = Encoding.ASCII.GetBytes(json.ToCharArray());
string webPostResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutinePostRequest(coroutineUrl, pData, value => webPostResponse = value));
}
}
private IEnumerator GetSecureAuthentication(Action<SecureAuthenticationProtocolState> result)
{
string versionCheckUrl = "http://localhost:8085/version";
string versionWebResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutineGetRequest(versionCheckUrl, value => versionWebResponse = value));
string v1 = versionWebResponse[23].ToString() + versionWebResponse[24].ToString() + versionWebResponse[25].ToString() + versionWebResponse[26].ToString() + versionWebResponse[27].ToString() + versionWebResponse[28].ToString() + versionWebResponse[29].ToString();
string v2 = "1.3.4.0";
var version1 = new Version(v1);
var version2 = new Version(v2);
var versionComparisonResult = version1.CompareTo(version2);
//If 1.3.4.0 or newer, use the new healthcheck endpoint.
if (versionComparisonResult >= 0)
{
string healthCheckUrl = "http://localhost:8085/healthcheck";
string SACWebResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutineGetRequest(healthCheckUrl, value => SACWebResponse = value));
if (SACWebResponse != "Error")
{
switch (SACWebResponse[10])
{
case 'B':
Debug.Log("Secure Authentication Protocol Enabled");
result(SecureAuthenticationProtocolState.SAPEnabled);
break;
case 'U':
Debug.Log("Secure Authentication Protocol Disabled");
result(SecureAuthenticationProtocolState.SAPDisabled);
break;
case '-':
Debug.Log("Omni Not Connected: Please Connect Omni");
result(SecureAuthenticationProtocolState.SAPError);
break;
default:
Debug.Log("Secure Authentication Protocol check failed. Returned Default.");
result(SecureAuthenticationProtocolState.SAPError);
break;
}
}
}
//If older than 1.3.4.0, use the old methods.
if (versionComparisonResult < 0)
{
string systemReadyCheckUrl = "http://localhost:8085/systemReady";
string systemReadyWebResponse = "-1";
yield return StartCoroutine(OmniConnectWebRequest.CoroutineGetRequest(systemReadyCheckUrl, value => systemReadyWebResponse = value));
if (systemReadyWebResponse.Contains("OK;Unsecure"))
{
result(SecureAuthenticationProtocolState.SAPDisabled);
}
else if (systemReadyWebResponse.Contains("OK;Secure"))
{
result(SecureAuthenticationProtocolState.SAPEnabled);
}
else
{
result(SecureAuthenticationProtocolState.SAPError);
}
}
}
public Vector3 GetForwardMovement()
{
return forwardMovement;
}
public Vector3 GetStrafeMovement()
{
return strafeMovement;
}
//angle difference between camera and omni angle, used for decoupled effect
protected float ComputeAngleBetweenControllerAndCamera()
{
float cameraYaw = cameraReference.rotation.eulerAngles.y;
float adjustedOmniYaw = currentOmniYaw - omniOffset + transform.rotation.eulerAngles.y;
float angleBetweenControllerAndCamera = 0f;
angleBetweenControllerAndCamera = Mathf.Abs(cameraYaw - adjustedOmniYaw) % 360;
angleBetweenControllerAndCamera = angleBetweenControllerAndCamera > 180 ? 360 - angleBetweenControllerAndCamera : angleBetweenControllerAndCamera;
//calculate sign
float angleForSignCalculation = (cameraYaw - adjustedOmniYaw) % 360;
float sign = (angleForSignCalculation >= 0 && angleForSignCalculation <= 180) ||
(angleForSignCalculation <= -180 && angleForSignCalculation >= -360) ? 1 : -1;
angleBetweenControllerAndCamera *= sign;
return angleBetweenControllerAndCamera;
}
//called on exit
void OnApplicationQuit()
{
StopOmni();
}
//called on scene change
void OnDisable()
{
StopOmni();
// Disable the reconnect attempting
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(OnDisable) - Uninstall Hook");
if (!isrunning) return;
SetWindowLongPtr(hMainWindow, -4, oldWndProcPtr);
hMainWindow = IntPtr.Zero;
oldWndProcPtr = IntPtr.Zero;
newWndProcPtr = IntPtr.Zero;
newWndProc = null;
isrunning = false;
}
void StopOmni()
{
if (omniManager != null)
{
omniManager.Cleanup();
omniManager = null;
}
}
/// <summary>
/// Finds the Omni so we can start reading data.
/// </summary>
public virtual void OmniInitialize()
{
if (developerMode)
{
if (cameraReference == null)
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(OmniInitialize) - Attempted to Initialize the Omni - developer mode is true and Camera Reference not set in prefab.");
return;
}
if (!OmniService.isPresent())
{
cameraReference.gameObject.AddComponent<SmoothMouseLook>();
Vector3 adjustedCameraPosition = cameraReference.localPosition;
adjustedCameraPosition.y = 1.5f;
cameraReference.localPosition = adjustedCameraPosition;
}
return;
}
// Create a new OmniManager and see if we can find the Omni
omniManager = new OmniManager();
if (omniManager.FindOmni())
{
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(OmniInitialize) - Successfully found the Omni.");
omniFound = true;
}
else
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(OmniInitialize) - Attempted to Initialize the Omni, but Omni not found.");
omniFound = false;
return;
}
}
void AttemptToReconnectTheOmni()
{
if (omniManager == null)
omniManager = new OmniManager();
if (!omniManager.omniDisconnected)
return;
if (omniManager.FindOmni())
{
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(AttemptToReconnectTheOmni) - Successfully found the Omni for reconnect.");
omniFound = true;
}
else
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(AttemptToReconnectTheOmni) - Attempted to Reconnect the Omni, but Omni not found.");
omniFound = false;
return;
}
}
/// <summary>
/// Pulls packets from the Omni and decodes them to populate the class variables and motiondata.
/// </summary>
void ReadOmniData()
{
byte[] packet = null;
if (omniManager.ReadData(ref packet) > 0)
{
OmniCommon.Messages.OmniBaseMessage obm = OmniCommon.OmniPacketBuilder.decodePacket(packet);
if (debugNotReceivingData == true || hasReceivedOmniData == false)
{
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(ReadOmniData) - During this frame, the Omni started reading data from the Omni data packet.");
debugNotReceivingData = false;
StartCoroutine(ConfigureOmniConnect());
}
hasReceivedOmniData = true;
if (obm != null)
{
switch (obm.MsgType)
{
case OmniCommon.Messages.MessageType.OmniMotionAndRawDataMessage:
OmniCommon.Messages.OmniMotionAndRawDataMessage OmniMotionAndRawData = new OmniCommon.Messages.OmniMotionAndRawDataMessage(obm);
motionData = OmniMotionAndRawData.GetMotionData();
break;
default:
break;
}
}
}
else
{
motionData = null;
if (debugNotReceivingData == false)
{
Debug.LogError(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(ReadOmniData) - During this frame, the Omni stopped receiving valid data from the Omni data packet.");
debugNotReceivingData = true;
}
}
if (motionData != null)
{
/*
debugCounterForDataMessages++;
if (debugCounterForDataMessages > 30)
{
Debug.Log(System.DateTime.Now.ToLongTimeString() +
": Timestamp = " + motionData.Timestamp +
"; Step count = " + motionData.StepCount +
"; Ring Angle = " + motionData.RingAngle +
"; Ring Delta = " + motionData.RingDelta +
"; joy x = " + motionData.GamePad_X +
"; joy y = " + motionData.GamePad_Y);
debugCounterForDataMessages = 0;
}*/
currentOmniYaw = motionData.RingAngle;
rawX = motionData.GamePad_X;
rawY = motionData.GamePad_Y;
omniX = motionData.GamePad_X;
omniY = motionData.GamePad_Y;
if (omniX > 0)
{
omniX = (omniX / 255.0f) * 2f - 1f;
}
else
omniX = -1f;
if (omniY > 0)
{
omniY = (omniY / 255.0f) * 2f - 1f;
}
else
omniY = -1;
//clamp '0'
if (rawX == 127)
{
omniX = 0f;
}
if (rawY == 127)
{
omniY = 0f;
}
//@TODO - may need to change this for fully coupled mode...
omniY *= -1f;
hidInput = new Vector2(omniX, omniY);
if (hasFullyInitialized) UpdateStepCountFromMotionData();
}
else
{
hidInput = Vector2.zero;
}
}
/// <summary>
/// Checks joystick or WASD for input if in developer mode
/// </summary>
void CheckInputForMovementTesting()
{
//Get values from joystick or WASD.
float inputX = Input.GetAxis("Horizontal");
float inputY = Input.GetAxis("Vertical");
//Clamp to deadzone
if (inputY < joystickDeadzone && inputY > 0 || inputY > -joystickDeadzone && inputY < 0)
{
inputY = 0;
}
if (inputX < joystickDeadzone && inputX > 0 || inputX > -joystickDeadzone && inputX < 0)
{
inputX = 0;
}
hidInput.y = inputY;
hidInput.x = inputX;
}
/// <summary>
/// Updates step count from motion data after getting the initial step count in the align.
/// </summary>
protected void UpdateStepCountFromMotionData()
{
if (motionData == null) return;
currentStepCount = (int)motionData.StepCount - startingStepCount;
}
/// <summary>
/// Resets step counter to 0. Call at anytime you want to reset the step count.
/// </summary>
public void ResetStepCount()
{
if (motionData == null) return;
startingStepCount = (int)motionData.StepCount;
currentStepCount = 0;
}
/// <summary>
/// Calibration Function. Sets up proper alignment between Omni and HMD based on Omni input data and HMD orientation.
/// </summary>
public virtual void CalibrateOmni()
{
if (!hasCalibrated)
{
//set offset to be current ring angle
if (motionData != null)
{
if ((cameraReference.transform.position.x != 0) && (cameraReference.transform.position.y != 0) && (cameraReference.transform.position.z != 0) &&
(cameraReference.rotation.eulerAngles.x != 0) && (cameraReference.rotation.eulerAngles.y != 0) && (cameraReference.rotation.eulerAngles.z != 0))
{
if (mySAPStatus == SecureAuthenticationProtocolState.SAPEnabled)
{
//omniOffset = OVSDK.GetOmniYawOffset();
omniOffset = OmniMovementCalibration.GetCalibrationValue();
}
else
{
omniOffset = OmniMovementCalibration.GetCalibrationValue();
}
hasCalibrated = true;
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(CalibrateOmni) - Successfully calibrated Omni.");
}
if (!hasFullyInitialized)
{
//grab initial step count here
ResetStepCount();
hasFullyInitialized = true;
}
}
}
}
public void GetOmniInputForCharacterMovement()
{
if (cameraReference == null)
{
Debug.LogError("OmniMovementComponent(GetOmniInputForCharacterMovement) - Camera Reference not set in prefab.");
return;
}
forwardMovement = new Vector3(0.0f, 0.0f, 0.0f);
strafeMovement = forwardMovement;
//calculate angle between camera and omni
angleBetweenOmniAndCamera = ComputeAngleBetweenControllerAndCamera();
float forwardRotation = 0f;
//keep within bounds (0, 360)
if (currentOmniYaw > 360f) currentOmniYaw -= 360f;
if (currentOmniYaw < 0f) currentOmniYaw += 360f;
//Get the coupling percentage from Omniverse
if (hasSetCouplingPercentage == false)
{
if (mySAPStatus == SecureAuthenticationProtocolState.SAPEnabled)
{
//couplingPercentage = developerMode ? 1.0f : OVSDK.GetOmniCoupleRate();
couplingPercentage = developerMode ? 1.0f : OmniMovementCalibration.GetCouplingPercentage();
hasSetCouplingPercentage = true;
}
else
{
couplingPercentage = developerMode ? 1.0f : OmniMovementCalibration.GetCouplingPercentage();
hasSetCouplingPercentage = true;
}
Debug.Log(System.DateTime.Now.ToLongTimeString() + ": OmniMovementComponent(GetOmniInputForCharacterMovement) - Coupling Percentage = " + couplingPercentage);
}
//calculate forward rotation
forwardRotation = (currentOmniYaw - omniOffset + transform.rotation.eulerAngles.y) + (angleBetweenOmniAndCamera * couplingPercentage);
//display forward rotation defined by our coupling percentage
dummyObject.rotation = Quaternion.Euler(0, forwardRotation, 0);
dummyForward = dummyObject.forward;
//calculate forward movement
Vector3 movementInputVector = new Vector3(hidInput.y * dummyForward.x, 0, hidInput.y * dummyForward.z);
//apply multiplier to reduce backwards movement speed by a given percentage
if (hidInput.y < 0) { movementInputVector *= backwardsSpeedMultiplier; }
//display rounded values
if (dummyForward.x != 0)
dummyForward.x = Mathf.Round(dummyForward.x * 100) / 100;
if (dummyForward.z != 0)
dummyForward.z = Mathf.Round(dummyForward.z * 100) / 100;
//apply gravity
movementInputVector += Physics.gravity * gravityMultiplier;
//perform forward movement
forwardMovement = (movementInputVector * maxSpeed * Time.deltaTime);
//check if there is strafe input
if (hidInput.x != 0)
{
//calculate strafe movement
movementInputVector = new Vector3(hidInput.x * dummyObject.right.x, 0, hidInput.x * dummyObject.right.z);
//apply modifier to reduce strafe movement by a given percentage
movementInputVector *= strafeSpeedMultiplier;
//apply gravity
movementInputVector += Physics.gravity * gravityMultiplier;
//perform strafe movement
strafeMovement = (movementInputVector * maxSpeed * Time.deltaTime);
}
}
void Update()
{
if (!developerMode)
{
ReadOmniData();
CalibrateOmni();
}
}
public virtual void DeveloperModeUpdate()
{
CheckInputForMovementTesting();
GetOmniInputForCharacterMovement();
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b4816de52c8590048a0c0dc7a647cbb2
timeCreated: 1497453778
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR;
public class OmniService
{
public static bool isPresent()
{
var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
foreach (var xrDisplay in xrDisplaySubsystems)
{
if (xrDisplay.running)
{
return true;
}
}
return false;
}
}

View File

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

View File

@ -0,0 +1,149 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
[AddComponentMenu("Camera-Control/Smooth Mouse Look")]
public class SmoothMouseLook : MonoBehaviour
{
public enum RotationAxes { MouseXAndY = 0, MouseX = 1, MouseY = 2 }
public RotationAxes axes = RotationAxes.MouseXAndY;
public float sensitivityX = 2.8F;
public float sensitivityY = 2.8F;
public float minimumX = -360F;
public float maximumX = 360F;
public float minimumY = -60F;
public float maximumY = 60F;
float rotationX = 0F;
float rotationY = 0F;
private List<float> rotArrayX = new List<float>();
float rotAverageX = 0F;
private List<float> rotArrayY = new List<float>();
float rotAverageY = 0F;
public float frameCounter = 3;
Quaternion originalRotation;
void Update()
{
if (axes == RotationAxes.MouseXAndY)
{
rotAverageY = 0f;
rotAverageX = 0f;
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotationX += Input.GetAxis("Mouse X") * sensitivityX;
rotArrayY.Add(rotationY);
rotArrayX.Add(rotationX);
if (rotArrayY.Count >= frameCounter)
{
rotArrayY.RemoveAt(0);
}
if (rotArrayX.Count >= frameCounter)
{
rotArrayX.RemoveAt(0);
}
for (int j = 0; j < rotArrayY.Count; j++)
{
rotAverageY += rotArrayY[j];
}
for (int i = 0; i < rotArrayX.Count; i++)
{
rotAverageX += rotArrayX[i];
}
rotAverageY /= rotArrayY.Count;
rotAverageX /= rotArrayX.Count;
rotAverageY = ClampAngle(rotAverageY, minimumY, maximumY);
rotAverageX = ClampAngle(rotAverageX, minimumX, maximumX);
Quaternion yQuaternion = Quaternion.AngleAxis(rotAverageY, Vector3.left);
Quaternion xQuaternion = Quaternion.AngleAxis(rotAverageX, Vector3.up);
transform.localRotation = originalRotation * xQuaternion * yQuaternion;
}
else if (axes == RotationAxes.MouseX)
{
rotAverageX = 0f;
rotationX += Input.GetAxis("Mouse X") * sensitivityX;
rotArrayX.Add(rotationX);
if (rotArrayX.Count >= frameCounter)
{
rotArrayX.RemoveAt(0);
}
for (int i = 0; i < rotArrayX.Count; i++)
{
rotAverageX += rotArrayX[i];
}
rotAverageX /= rotArrayX.Count;
rotAverageX = ClampAngle(rotAverageX, minimumX, maximumX);
Quaternion xQuaternion = Quaternion.AngleAxis(rotAverageX, Vector3.up);
transform.localRotation = originalRotation * xQuaternion;
}
else
{
rotAverageY = 0f;
rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
rotArrayY.Add(rotationY);
if (rotArrayY.Count >= frameCounter)
{
rotArrayY.RemoveAt(0);
}
for (int j = 0; j < rotArrayY.Count; j++)
{
rotAverageY += rotArrayY[j];
}
rotAverageY /= rotArrayY.Count;
rotAverageY = ClampAngle(rotAverageY, minimumY, maximumY);
Quaternion yQuaternion = Quaternion.AngleAxis(rotAverageY, Vector3.left);
transform.localRotation = originalRotation * yQuaternion;
}
transform.localEulerAngles = new Vector3(transform.localRotation.eulerAngles.x, transform.localRotation.eulerAngles.y, 0.0f);
}
void Start()
{
Debug.Log("SmoothMouseLook(Start) - Smooth Mouse Look added to the Character");
Rigidbody rb = GetComponent<Rigidbody>();
if (rb)
rb.freezeRotation = true;
originalRotation = transform.localRotation;
}
public static float ClampAngle(float angle, float min, float max)
{
angle = angle % 360;
if ((angle >= -360F) && (angle <= 360F))
{
if (angle < -360F)
{
angle += 360F;
}
if (angle > 360F)
{
angle -= 360F;
}
}
return Mathf.Clamp(angle, min, max);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: afad5bfc7bb772d42a301521e3cee584
timeCreated: 1461919201
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class VRUtilService : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

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

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 14b3d8265b09caa4b8709cf8990ef82a
folderAsset: yes
timeCreated: 1459944460
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,57 @@
fileFormatVersion: 2
guid: 182fa9c20991bb64a873c30c3170549b
timeCreated: 1440516328
licenseType: Pro
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: 8
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: 2
aniso: 9
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
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
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,42 +0,0 @@
<?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>BuildMachineOSBuild</key>
<string>14F27</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>hidapi</string>
<key>CFBundleIdentifier</key>
<string>com.signal11.hidapi</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>hidapi</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>6E35b</string>
<key>DTPlatformVersion</key>
<string>GM</string>
<key>DTSDKBuild</key>
<string>14D125</string>
<key>DTSDKName</key>
<string>macosx10.10</string>
<key>DTXcode</key>
<string>0640</string>
<key>DTXcodeBuild</key>
<string>6E35b</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2015 signal11. All rights reserved.</string>
</dict>
</plist>

View File

@ -1,80 +0,0 @@
fileFormatVersion: 2
guid: ee0f84db49b44d7448a02c2d48ba6060
timeCreated: 1428024569
licenseType: Free
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
CPU: x86
DefaultValueInitialized: true
OS: Windows
Linux:
enabled: 1
settings:
CPU: x86
Linux64:
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel64:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
enabled: 0
settings:
STV_MODEL: STANDARD_13
WP8:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
Win:
enabled: 1
settings:
CPU: AnyCPU
Win64:
enabled: 0
settings:
CPU: None
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
iOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,80 +0,0 @@
fileFormatVersion: 2
guid: 7dcce2f108b04db43aa674e44c1c1235
timeCreated: 1428204958
licenseType: Free
PluginImporter:
serializedVersion: 1
iconMap: {}
executionOrder: {}
isPreloaded: 0
platformData:
Android:
enabled: 0
settings:
CPU: AnyCPU
Any:
enabled: 0
settings: {}
Editor:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
Linux:
enabled: 1
settings:
CPU: x86
Linux64:
enabled: 1
settings:
CPU: x86_64
LinuxUniversal:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel:
enabled: 1
settings:
CPU: AnyCPU
OSXIntel64:
enabled: 1
settings:
CPU: AnyCPU
OSXUniversal:
enabled: 1
settings:
CPU: AnyCPU
SamsungTV:
enabled: 0
settings:
STV_MODEL: STANDARD_13
WP8:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
Win:
enabled: 0
settings:
CPU: None
Win64:
enabled: 1
settings:
CPU: AnyCPU
WindowsStoreApps:
enabled: 0
settings:
CPU: AnyCPU
DontProcess: False
PlaceholderPath:
SDK: AnySDK
iOS:
enabled: 0
settings:
CompileFlags:
FrameworkDependencies:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -26,11 +26,11 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 866662310}
m_LocalRotation: {x: 0, y: 1, z: 0, w: 0}
m_LocalPosition: {x: 0, y: -0.37, z: 0}
m_LocalRotation: {x: -0, y: 1, z: -0, w: 0}
m_LocalPosition: {x: 0, y: -0.3699999, z: 0}
m_LocalScale: {x: 0.127872, y: 0.127872, z: 0.127872}
m_Children: []
m_Father: {fileID: 3224832258464791432}
m_Father: {fileID: 3827260016698053497}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0}
--- !u!33 &866662314
@ -331,7 +331,7 @@ Transform:
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
m_Children: []
m_Father: {fileID: 8406466218123916952}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: -40.494, y: 0, z: 0}
--- !u!23 &3224832257380790147
MeshRenderer:
@ -521,7 +521,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8406466218123916952}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3224832257896867165
MonoBehaviour:
@ -664,6 +664,121 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
body: {fileID: 2949611238048620088}
--- !u!54 &2923504239445864912
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
serializedVersion: 2
m_Mass: 10
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!136 &567479351034177329
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 1.65
m_Height: 0
m_Direction: 1
m_Center: {x: 0, y: 0.01, z: 0}
--- !u!114 &2552885260119797580
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1c56a27abb4b87b419b7fa61804fd6f8, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 0}
--- !u!114 &4563765638380076028
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d6c86531c866cd5409820556c3fc2c4e, type: 3}
m_Name:
m_EditorClassIdentifier:
selectedMovement: 4
nomDuJoueur:
--- !u!114 &5514558263413064935
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 21b58e0dd1248034c871465fc721b43c, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 0}
--- !u!114 &6715782188142404965
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d6c19446783f148a1933e20dd05b52, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 0}
constSpeed: 0
constRotation: 0
constUpForce: 0
--- !u!114 &8110960371752871077
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a3db9d02d190fcb46a9646c275a560e4, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 0}
constSpeed: 0
constRotation: 0
constUpForce: 0
--- !u!114 &8261473563288267383
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3827260016697770625}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 32e5e814edc24cf41999243fa65b4488, type: 3}
m_Name:
m_EditorClassIdentifier:
body: {fileID: 0}
--- !u!1 &4216049522789318228
GameObject:
m_ObjectHideFlags: 0
@ -691,6 +806,7 @@ Transform:
m_LocalPosition: {x: 9.918372, y: 0.49708378, z: 7.3539944}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3827260016698053497}
- {fileID: 3224832258464791432}
- {fileID: 3119409764465405126}
- {fileID: 3228749051654165582}
@ -779,7 +895,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8406466218123916952}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3881387924960372470
MonoBehaviour:
@ -808,7 +924,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1000012106565122, guid: 1b474618c4fc5f54e8a8b803c8352c7d, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4000013012824352, guid: 1b474618c4fc5f54e8a8b803c8352c7d, type: 3}
propertyPath: m_LocalScale.y
@ -816,7 +932,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4000014291504098, guid: 1b474618c4fc5f54e8a8b803c8352c7d, type: 3}
propertyPath: m_RootOrder
value: 2
value: 3
objectReference: {fileID: 0}
- target: {fileID: 4000014291504098, guid: 1b474618c4fc5f54e8a8b803c8352c7d, type: 3}
propertyPath: m_LocalPosition.x
@ -865,12 +981,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 1b474618c4fc5f54e8a8b803c8352c7d, type: 3}
--- !u!4 &3228749051654165582 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4000014291504098, guid: 1b474618c4fc5f54e8a8b803c8352c7d,
type: 3}
m_PrefabInstance: {fileID: 3224832256724492204}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3266769659237790072 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 114000013141257940, guid: 1b474618c4fc5f54e8a8b803c8352c7d,
@ -883,6 +993,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 03a7614f10832d041bccff167d2a460f, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &3228749051654165582 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4000014291504098, guid: 1b474618c4fc5f54e8a8b803c8352c7d,
type: 3}
m_PrefabInstance: {fileID: 3224832256724492204}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3224832256823326679
PrefabInstance:
m_ObjectHideFlags: 0
@ -1050,7 +1166,7 @@ PrefabInstance:
- target: {fileID: -8679921383154817045, guid: 56fd8a0aa3b18fa43994e325b7d32a93,
type: 3}
propertyPath: m_RootOrder
value: 1
value: 2
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 56fd8a0aa3b18fa43994e325b7d32a93,
type: 3}
@ -1242,7 +1358,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 100008, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 100008, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 3}
propertyPath: m_TagString
@ -1250,7 +1366,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 3}
propertyPath: m_RootOrder
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 400006, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 3}
propertyPath: m_LocalPosition.x
@ -1318,24 +1434,6 @@ PrefabInstance:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: ce816f2e6abb0504092c23ed9b970dfd, type: 3}
--- !u!4 &3228805174263641156 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4471613377008970, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!4 &3224832258464740994 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 481164, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!4 &3224832258464737004 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 477154, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3224832258475577946 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 11400020, guid: ce816f2e6abb0504092c23ed9b970dfd,
@ -1348,6 +1446,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: df9f338034892c44ebb62d97894772f1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &3224832258464737004 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 477154, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3224832258475577924 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 11400010, guid: ce816f2e6abb0504092c23ed9b970dfd,
@ -1378,6 +1482,18 @@ GameObject:
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!4 &3228805174263641156 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4471613377008970, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!4 &3224832258464740994 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 481164, guid: ce816f2e6abb0504092c23ed9b970dfd,
type: 3}
m_PrefabInstance: {fileID: 3224832258464915726}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3224832258796056233
PrefabInstance:
m_ObjectHideFlags: 0
@ -1445,3 +1561,90 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 3224832258796056233}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &3827260016697655125
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 8406466218123916952}
m_Modifications:
- target: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_Name
value: '[CameraRig]'
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.x
value: 1.218103
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.y
value: 1.641916
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalPosition.z
value: -2.294073
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2348914, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 0}
- target: {fileID: 3380982, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 4750165665577805220, guid: 4d293c8e162f3874b982baadd71153d2,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5795630119822265612, guid: 4d293c8e162f3874b982baadd71153d2,
type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4d293c8e162f3874b982baadd71153d2, type: 3}
--- !u!4 &3827260016698053497 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2,
type: 3}
m_PrefabInstance: {fileID: 3827260016697655125}
m_PrefabAsset: {fileID: 0}
--- !u!1 &3827260016697770625 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2,
type: 3}
m_PrefabInstance: {fileID: 3827260016697655125}
m_PrefabAsset: {fileID: 0}

File diff suppressed because it is too large Load Diff

8
Assets/SteamVR.meta Normal file
View File

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

View File

@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: c33af0785775d7548b22541da37936fe
folderAsset: yes
DefaultImporter:
userData:
assetBundleName:

View File

@ -0,0 +1,351 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Prompt developers to use settings most compatible with SteamVR.
//
//=============================================================================
//2019 will use some of this
#if (UNITY_2018_1_OR_NEWER && !UNITY_2020_1_OR_NEWER)
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Reflection;
using Valve.VR.InteractionSystem;
using UnityEditor.Callbacks;
#pragma warning disable CS0618
#pragma warning disable CS0219
#pragma warning disable CS0414
namespace Valve.VR
{
#if (UNITY_2018_1_OR_NEWER && !UNITY_2019_1_OR_NEWER)
public class SteamVR_AutoEnableVR_2018to2019
{
[DidReloadScripts]
private static void OnReload()
{
SteamVR_AutoEnableVR_UnityPackage.InstallAndEnableUnityVR();
}
}
#endif
public class SteamVR_AutoEnableVR_UnityPackage
{
private static bool? _forceInstall;
private const string forceInstallKey = "steamvr.autoenablevr.forceInstall";
private static bool? _forceEnable;
private const string forceEnableKey = "steamvr.autoenablevr.forceEnable";
private static PackageStates? _updateState;
private const string updateStateKey = "steamvr.autoenablevr.updateState";
private static bool forceInstall
{
get
{
if (_forceInstall.HasValue == false)
{
if (EditorPrefs.HasKey(forceInstallKey))
_forceInstall = EditorPrefs.GetBool(forceInstallKey);
else
_forceInstall = false;
}
return _forceInstall.Value;
}
set
{
_forceInstall = value;
EditorPrefs.SetBool(forceInstallKey, value);
}
}
private static bool forceEnable
{
get
{
if (_forceEnable.HasValue == false)
{
if (EditorPrefs.HasKey(forceEnableKey))
_forceEnable = EditorPrefs.GetBool(forceEnableKey);
else
_forceEnable = false;
}
return _forceEnable.Value;
}
set
{
_forceEnable = value;
EditorPrefs.SetBool(forceEnableKey, value);
}
}
private static void UpdateUpdateStateFromPrefs()
{
if (_updateState.HasValue == false)
{
if (EditorPrefs.HasKey(updateStateKey))
_updateState = (PackageStates)EditorPrefs.GetInt(updateStateKey);
else
_updateState = PackageStates.None;
}
}
private static PackageStates updateState
{
get
{
if (_updateState.HasValue == false)
UpdateUpdateStateFromPrefs();
return _updateState.Value;
}
set
{
_updateState = value;
EditorPrefs.SetInt(updateStateKey, (int)value);
}
}
public static void InstallAndEnableUnityVR(bool forceInstall = false, bool forceEnable = false)
{
_forceInstall = forceInstall;
_forceEnable = forceEnable;
EditorApplication.update += Update;
}
protected const string openVRString = "OpenVR";
protected const string unityOpenVRPackageString = "com.unity.xr.openvr.standalone";
protected const string valveOpenVRPackageString = "com.valvesoftware.unity.openvr";
private enum PackageStates
{
None,
WaitingForList,
WaitingForAdd,
WaitingForAddConfirm,
Installed,
Failed,
}
private static UnityEditor.PackageManager.Requests.ListRequest listRequest;
private static UnityEditor.PackageManager.Requests.AddRequest addRequest;
private static System.Diagnostics.Stopwatch addingPackageTime = new System.Diagnostics.Stopwatch();
private static System.Diagnostics.Stopwatch addingPackageTimeTotal = new System.Diagnostics.Stopwatch();
private static float estimatedTimeToInstall = 80;
private static int addTryCount = 0;
private static void End()
{
updateState = PackageStates.None;
addingPackageTime.Stop();
addingPackageTimeTotal.Stop();
UnityEditor.EditorUtility.ClearProgressBar();
EditorApplication.update -= Update;
}
public static void Update()
{
if (!SteamVR_Settings.instance.autoEnableVR || Application.isPlaying)
End();
if (UnityEditor.PlayerSettings.virtualRealitySupported == false)
{
if (forceInstall == false)
{
int shouldInstall = UnityEditor.EditorUtility.DisplayDialogComplex("SteamVR", "Would you like to enable Virtual Reality mode?\n\nThis will install the OpenVR for Desktop package and enable it in Player Settings.", "Yes", "No, and don't ask again", "No");
switch (shouldInstall)
{
case 0: //yes
UnityEditor.PlayerSettings.virtualRealitySupported = true;
break;
case 1: //no
End();
return;
case 2: //no, don't ask
SteamVR_Settings.instance.autoEnableVR = false;
SteamVR_Settings.Save();
End();
return;
}
}
Debug.Log("<b>[SteamVR Setup]</b> Enabled virtual reality support in Player Settings. (you can disable this by unchecking Assets/SteamVR/SteamVR_Settings.autoEnableVR)");
}
switch (updateState)
{
case PackageStates.None:
//see if we have the package
listRequest = UnityEditor.PackageManager.Client.List(true);
updateState = PackageStates.WaitingForList;
break;
case PackageStates.WaitingForList:
if (listRequest == null)
{
listRequest = UnityEditor.PackageManager.Client.List(true);
updateState = PackageStates.WaitingForList;
}
else if (listRequest.IsCompleted)
{
if (listRequest.Error != null || listRequest.Status == UnityEditor.PackageManager.StatusCode.Failure)
{
updateState = PackageStates.Failed;
break;
}
string packageName = unityOpenVRPackageString;
bool hasPackage = listRequest.Result.Any(package => package.name == packageName);
if (hasPackage == false)
{
//if we don't have the package - then install it
addRequest = UnityEditor.PackageManager.Client.Add(packageName);
updateState = PackageStates.WaitingForAdd;
addTryCount++;
Debug.Log("<b>[SteamVR Setup]</b> Installing OpenVR package...");
addingPackageTime.Start();
addingPackageTimeTotal.Start();
}
else
{
//if we do have the package, make sure it's enabled.
updateState = PackageStates.Installed; //already installed
}
}
break;
case PackageStates.WaitingForAdd:
if (addRequest.IsCompleted)
{
if (addRequest.Error != null || addRequest.Status == UnityEditor.PackageManager.StatusCode.Failure)
{
updateState = PackageStates.Failed;
break;
}
else
{
//if the package manager says we added it then confirm that with the list
listRequest = UnityEditor.PackageManager.Client.List(true);
updateState = PackageStates.WaitingForAddConfirm;
}
}
else
{
if (addingPackageTimeTotal.Elapsed.TotalSeconds > estimatedTimeToInstall)
{
if (addTryCount == 1)
estimatedTimeToInstall *= 2; //give us more time to retry
else
updateState = PackageStates.Failed;
}
string dialogText;
if (addTryCount == 1)
dialogText = "Installing OpenVR from Unity Package Manager...";
else
dialogText = "Retrying OpenVR install from Unity Package Manager...";
bool cancel = UnityEditor.EditorUtility.DisplayCancelableProgressBar("SteamVR", dialogText, (float)addingPackageTimeTotal.Elapsed.TotalSeconds / estimatedTimeToInstall);
if (cancel)
updateState = PackageStates.Failed;
if (addingPackageTime.Elapsed.TotalSeconds > 10)
{
Debug.Log("<b>[SteamVR Setup]</b> Waiting for package manager to install OpenVR package...");
addingPackageTime.Stop();
addingPackageTime.Reset();
addingPackageTime.Start();
}
}
break;
case PackageStates.WaitingForAddConfirm:
if (listRequest.IsCompleted)
{
if (listRequest.Error != null)
{
updateState = PackageStates.Failed;
break;
}
string packageName = unityOpenVRPackageString;
bool hasPackage = listRequest.Result.Any(package => package.name == packageName);
if (hasPackage == false)
{
if (addTryCount == 1)
{
addRequest = UnityEditor.PackageManager.Client.Add(packageName);
updateState = PackageStates.WaitingForAdd;
addTryCount++;
Debug.Log("<b>[SteamVR Setup]</b> Retrying OpenVR package install...");
}
else
{
updateState = PackageStates.Failed;
}
}
else
{
updateState = PackageStates.Installed; //installed successfully
Debug.Log("<b>[SteamVR Setup]</b> Successfully installed OpenVR Desktop package.");
}
}
break;
case PackageStates.Installed:
UnityEditor.BuildTargetGroup currentTarget = UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup;
string[] devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(currentTarget);
bool hasOpenVR = false;
bool isFirst = false;
if (devices.Length != 0)
{
int index = Array.FindIndex(devices, device => string.Equals(device, openVRString, System.StringComparison.CurrentCultureIgnoreCase));
hasOpenVR = index != -1;
isFirst = index == 0;
}
//list openvr as the first option if it was in the list already
List<string> devicesList = new List<string>(devices);
if (isFirst == false)
{
if (hasOpenVR == true)
devicesList.Remove(openVRString);
devicesList.Insert(0, openVRString);
string[] newDevices = devicesList.ToArray();
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(currentTarget, newDevices);
Debug.Log("<b>[SteamVR Setup]</b> Added OpenVR to supported VR SDKs list.");
}
End();
break;
case PackageStates.Failed:
End();
string failtext = "The Unity Package Manager failed to automatically install the OpenVR Desktop package. Please open the Package Manager Window and try to install it manually.";
UnityEditor.EditorUtility.DisplayDialog("SteamVR", failtext, "Ok");
Debug.Log("<b>[SteamVR Setup]</b> " + failtext);
break;
}
}
}
}
#endif

View File

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

View File

@ -0,0 +1,323 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Prompt developers to use settings most compatible with SteamVR.
//
//=============================================================================
#if (UNITY_2019_1_OR_NEWER)
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Reflection;
using Valve.VR.InteractionSystem;
using UnityEditor.Callbacks;
#if OPENVR_XR_API
using UnityEditor.XR.Management.Metadata;
using UnityEngine.XR.Management;
using UnityEditor.XR.Management;
#endif
#pragma warning disable CS0618
#pragma warning disable CS0219
#pragma warning disable CS0414
namespace Valve.VR
{
#if (UNITY_2019_1_OR_NEWER && !UNITY_2020_1_OR_NEWER)
public class SteamVR_AutoEnableVR_2019to2020
{
[DidReloadScripts]
private static void OnReload()
{
#if !OPENVR_XR_API
//if we don't have xr installed, check to see if we have vr installed. if we don't have vr installed, ask which they do want to install.
SteamVR_AutoEnableVR_2019.CheckAndAsk();
#else
//since we already have xr installed, we know we just want to enable it
SteamVR_AutoEnableVR_UnityXR.EnableUnityXR();
#endif
}
}
#endif
#if (UNITY_2020_1_OR_NEWER)
public class SteamVR_AutoEnableVR_2020Plus
{
[DidReloadScripts]
private static void OnReload()
{
#if !OPENVR_XR_API
SteamVR_AutoEnableVR_UnityXR.InstallAndEnableUnityXR();
#else
//since we already have xr installed, we know we just want to enable it
SteamVR_AutoEnableVR_UnityXR.EnableUnityXR();
#endif
}
}
#endif
#if (UNITY_2019_1_OR_NEWER && !UNITY_2020_1_OR_NEWER)
public class SteamVR_AutoEnableVR_2019
{
public static void CheckAndAsk()
{
EditorApplication.update += Update;
}
protected const string openVRString = "OpenVR";
protected const string unityOpenVRPackageString = "com.unity.xr.openvr.standalone";
protected const string valveOpenVRPackageString = "com.valvesoftware.unity.openvr";
private enum PackageStates
{
None,
WaitingForList,
Complete,
Failed,
}
private static UnityEditor.PackageManager.Requests.ListRequest listRequest;
private static PackageStates packageState = PackageStates.None;
private static void End()
{
packageState = PackageStates.None;
UnityEditor.EditorUtility.ClearProgressBar();
EditorApplication.update -= Update;
}
private static void ShowDialog()
{
int shouldInstall = UnityEditor.EditorUtility.DisplayDialogComplex("SteamVR", "The SteamVR Unity Plugin can be used with the legacy Unity VR API (Unity 5.4 - 2019) or with the Unity XR API (2019+). Would you like to install in legacy VR mode or for Unity XR?", "Legacy VR", "Cancel", "Unity XR");
switch (shouldInstall)
{
case 0: //legacy vr
SteamVR_AutoEnableVR_UnityPackage.InstallAndEnableUnityVR();
break;
case 1: //cancel
break;
case 2: //unity xr
SteamVR_AutoEnableVR_UnityXR.InstallAndEnableUnityXR();
break;
}
End();
}
public static void Update()
{
if (!SteamVR_Settings.instance.autoEnableVR || Application.isPlaying)
End();
if (UnityEditor.PlayerSettings.virtualRealitySupported == false)
{
ShowDialog();
return;
}
switch (packageState)
{
case PackageStates.None:
//see if we have the package
listRequest = UnityEditor.PackageManager.Client.List(true);
packageState = PackageStates.WaitingForList;
break;
case PackageStates.WaitingForList:
if (listRequest.IsCompleted)
{
if (listRequest.Error != null || listRequest.Status == UnityEditor.PackageManager.StatusCode.Failure)
{
packageState = PackageStates.Failed;
break;
}
string packageName = unityOpenVRPackageString;
bool hasPackage = listRequest.Result.Any(package => package.name == packageName);
if (hasPackage == false)
ShowDialog();
else //if we do have the package, do nothing
End();
}
break;
case PackageStates.Failed:
End();
string failtext = "The Unity Package Manager failed to verify the OpenVR package. If you were trying to install it you may need to open the Package Manager Window and try to install it manually.";
UnityEditor.EditorUtility.DisplayDialog("SteamVR", failtext, "Ok");
Debug.Log("<b>[SteamVR Setup]</b> " + failtext);
break;
}
}
}
#endif
// todo: split the below into an install and an enable section
public class SteamVR_AutoEnableVR_UnityXR
{
public static void InstallAndEnableUnityXR()
{
StartXRInstaller();
EditorApplication.update += Update;
}
public static void EnableUnityXR()
{
EditorApplication.update += Update;
}
protected const string openVRString = "OpenVR";
protected const string unityOpenVRPackageString = "com.unity.xr.openvr.standalone";
protected const string valveOpenVRPackageString = "com.valvesoftware.unity.openvr";
private enum PackageStates
{
None,
WaitingForList,
WaitingForAdd,
WaitingForAddConfirm,
Installed,
Failed,
}
private static UnityEditor.PackageManager.Requests.ListRequest listRequest;
private static UnityEditor.PackageManager.Requests.AddRequest addRequest;
private static PackageStates packageState = PackageStates.None;
private static System.Diagnostics.Stopwatch addingPackageTime = new System.Diagnostics.Stopwatch();
private static System.Diagnostics.Stopwatch addingPackageTimeTotal = new System.Diagnostics.Stopwatch();
private static float estimatedTimeToInstall = 80;
private static int addTryCount = 0;
private static string enabledLoaderKey = null;
private static MethodInfo isLoaderAssigned;
private static MethodInfo installPackageAndAssignLoaderForBuildTarget;
private static Type[] isLoaderAssignedMethodParameters;
private static object[] isLoaderAssignedCallParameters;
private static void End()
{
addingPackageTime.Stop();
addingPackageTimeTotal.Stop();
UnityEditor.EditorUtility.ClearProgressBar();
EditorApplication.update -= Update;
}
public static void Update()
{
if (!SteamVR_Settings.instance.autoEnableVR)
End();
#if OPENVR_XR_API
EnableLoader();
#endif
}
#if OPENVR_XR_API
private static EditorWindow settingsWindow = null;
private static int skipEditorFrames = 5;
public static void EnableLoader()
{
if (skipEditorFrames > 0)
{
skipEditorFrames--;
return;
}
if (enabledLoaderKey == null)
enabledLoaderKey = string.Format(valveEnabledLoaderKeyTemplate, SteamVR_Settings.instance.editorAppKey);
if (EditorPrefs.HasKey(enabledLoaderKey) == false)
{
if (UnityEditor.PlayerSettings.virtualRealitySupported == true)
{
UnityEditor.PlayerSettings.virtualRealitySupported = false;
Debug.Log("<b>[SteamVR Setup]</b> Disabled virtual reality support in Player Settings. <b>Because you're using XR Manager. Make sure OpenVR Loader is enabled in XR Manager UI.</b> (you can disable this by unchecking Assets/SteamVR/SteamVR_Settings.autoEnableVR)");
}
var generalSettings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(BuildTargetGroup.Standalone);
if (generalSettings == null)
{
if (settingsWindow == null)
{
settingsWindow = SettingsService.OpenProjectSettings("Project/XR Plug-in Management");
settingsWindow.Repaint();
return;
}
if (settingsWindow == null || generalSettings == null)
{
Debug.LogWarning("<b>[SteamVR Setup]</b> Unable to access standalone xr settings while trying to enable OpenVR Loader. <b>You may need to manually enable OpenVR Loader in XR Plug-in Management (Project Settings).</b> (you can disable this by unchecking Assets/SteamVR/SteamVR_Settings.autoEnableVR)");
return;
}
}
if (generalSettings.AssignedSettings == null)
{
var assignedSettings = ScriptableObject.CreateInstance<XRManagerSettings>() as XRManagerSettings;
generalSettings.AssignedSettings = assignedSettings;
EditorUtility.SetDirty(generalSettings);
}
bool existing = generalSettings.AssignedSettings.loaders.Any(loader => loader.name == valveOpenVRLoaderType);
foreach (var loader in generalSettings.AssignedSettings.loaders)
{
Debug.Log("loader: " + loader.name);
}
if (!existing)
{
bool status = XRPackageMetadataStore.AssignLoader(generalSettings.AssignedSettings, valveOpenVRLoaderType, BuildTargetGroup.Standalone);
if (status)
Debug.Log("<b>[SteamVR Setup]</b> Enabled OpenVR Loader in XR Management");
else
Debug.LogError("<b>[SteamVR Setup]</b> Failed to enable enable OpenVR Loader in XR Management. You may need to manually open the XR Plug-in Management tab in project settings and check the OpenVR Loader box.");
}
EditorPrefs.SetBool(enabledLoaderKey, true);
}
End();
}
#endif
protected const string valveEnabledLoaderKeyTemplate = "valve.enabledxrloader.{0}";
protected const string valveOpenVRLoaderType = "Unity.XR.OpenVR.OpenVRLoader";
private static void StartXRInstaller()
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
for (int assemblyIndex = 0; assemblyIndex < assemblies.Length; assemblyIndex++)
{
Assembly assembly = assemblies[assemblyIndex];
Type type = assembly.GetType("Unity.XR.OpenVR.OpenVRPackageInstaller");
if (type != null)
{
MethodInfo preinitMethodInfo = type.GetMethod("Start");
if (preinitMethodInfo != null)
{
preinitMethodInfo.Invoke(null, new object[] { true });
return;
}
}
}
}
}
}
#endif

View File

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

View File

@ -0,0 +1,123 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Prompt developers to use settings most compatible with SteamVR.
//
//=============================================================================
#if (UNITY_5_4_OR_NEWER && !UNITY_2018_1_OR_NEWER)
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Reflection;
using UnityEditor.Callbacks;
namespace Valve.VR
{
public class SteamVR_AutoEnableVR_54to2018
{
[DidReloadScripts]
private static void OnReload()
{
EditorApplication.update += Update;
}
protected const string openVRString = "OpenVR";
private static void End()
{
EditorApplication.update -= Update;
}
public static void Update()
{
if (!SteamVR_Settings.instance.autoEnableVR || Application.isPlaying)
End();
bool enabledVR = false;
int shouldInstall = -1;
if (UnityEditor.PlayerSettings.virtualRealitySupported == false)
{
shouldInstall = UnityEditor.EditorUtility.DisplayDialogComplex("SteamVR", "Would you like to enable Virtual Reality mode?\n\nThis will enable Virtual Reality in Player Settings and add OpenVR as a target.", "Yes", "No, and don't ask again", "No");
switch (shouldInstall)
{
case 0: //yes
UnityEditor.PlayerSettings.virtualRealitySupported = true;
break;
case 1: //no:
UnityEditor.EditorApplication.update -= Update;
return;
case 2: //no, don't ask
SteamVR_Settings.instance.autoEnableVR = false;
SteamVR_Settings.Save();
UnityEditor.EditorApplication.update -= Update;
return;
}
}
UnityEditor.BuildTargetGroup currentTarget = UnityEditor.EditorUserBuildSettings.selectedBuildTargetGroup;
#if UNITY_5_6_OR_NEWER
string[] devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevicesOnTargetGroup(currentTarget);
#else
string[] devices = UnityEditorInternal.VR.VREditor.GetVREnabledDevices(currentTarget);
#endif
bool hasOpenVR = devices.Any(device => string.Equals(device, openVRString, System.StringComparison.CurrentCultureIgnoreCase));
if (hasOpenVR == false || enabledVR)
{
string[] newDevices;
if (enabledVR && hasOpenVR == false)
{
newDevices = new string[] { openVRString }; //only list openvr if we enabled it
}
else
{
List<string> devicesList = new List<string>(devices); //list openvr as the first option if it wasn't in the list.
if (hasOpenVR)
devicesList.Remove(openVRString);
devicesList.Insert(0, openVRString);
newDevices = devicesList.ToArray();
}
int shouldEnable = -1;
if (shouldInstall == 0)
shouldEnable = 0;
else
shouldEnable = UnityEditor.EditorUtility.DisplayDialogComplex("SteamVR", "Would you like to enable OpenVR as a VR target?", "Yes", "No, and don't ask again", "No");
switch (shouldEnable)
{
case 0: //yes
#if UNITY_5_6_OR_NEWER
UnityEditorInternal.VR.VREditor.SetVREnabledDevicesOnTargetGroup(currentTarget, newDevices);
#else
UnityEditorInternal.VR.VREditor.SetVREnabledDevices(currentTarget, newDevices);
#endif
Debug.Log("<b>[SteamVR Setup]</b> Added OpenVR to supported VR SDKs list.");
break;
case 1: //no:
break;
case 2: //no, don't ask
SteamVR_Settings.instance.autoEnableVR = false;
SteamVR_Settings.Save();
break;
}
}
UnityEditor.EditorApplication.update -= Update;
}
}
}
#endif

View File

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

View File

@ -0,0 +1,36 @@
{
"name": "SteamVR_Editor",
"references": [
"SteamVR",
"Unity.XR.OpenVR",
"Unity.XR.Management.Editor",
"Unity.XR.Management"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.valvesoftware.unity.openvr",
"expression": "",
"define": "OPENVR_XR_API"
},
{
"name": "com.unity.xr.management",
"expression": "3.2.0",
"define": "XR_MGMT_GTE_320"
},
{
"name": "com.unity.xr.management",
"expression": "",
"define": "XR_MGMT"
}
],
"noEngineReferences": false
}

View File

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

View File

@ -0,0 +1,127 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Camera
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
using Valve.VR;
[CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects]
public class SteamVR_Editor : Editor
{
int bannerHeight = 150;
Texture logo;
SerializedProperty script, wireframe;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
void OnEnable()
{
var resourcePath = GetResourcePath();
logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
script = serializedObject.FindProperty("m_Script");
wireframe = serializedObject.FindProperty("wireframe");
foreach (SteamVR_Camera target in targets)
target.ForceLast();
}
public override void OnInspectorGUI()
{
serializedObject.Update();
var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
if (!Application.isPlaying)
{
var expand = false;
var collapse = false;
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
collapse = true;
else
expand = true;
}
if (expand)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Expand"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (!target.isExpanded)
{
target.Expand();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
if (collapse)
{
GUILayout.BeginHorizontal();
if (GUILayout.Button("Collapse"))
{
foreach (SteamVR_Camera target in targets)
{
if (AssetDatabase.Contains(target))
continue;
if (target.isExpanded)
{
target.Collapse();
EditorUtility.SetDirty(target);
}
}
}
GUILayout.Space(18);
GUILayout.EndHorizontal();
}
}
EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(wireframe);
serializedObject.ApplyModifiedProperties();
}
public static void ExportPackage()
{
AssetDatabase.ExportPackage(new string[] {
"Assets/SteamVR",
"Assets/Plugins/openvr_api.cs",
"Assets/Plugins/openvr_api.bundle",
"Assets/Plugins/x86/openvr_api.dll",
"Assets/Plugins/x86/steam_api.dll",
"Assets/Plugins/x86/libsteam_api.so",
"Assets/Plugins/x86_64/openvr_api.dll",
"Assets/Plugins/x86_64/steam_api.dll",
"Assets/Plugins/x86_64/libsteam_api.so",
"Assets/Plugins/x86_64/libopenvr_api.so",
}, "steamvr.unitypackage", ExportPackageOptions.Recurse);
EditorApplication.Exit(0);
}
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 5ba22c80948c94e44a82b9fd1b3abd0d
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:

View File

@ -0,0 +1,2 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//removed and added to the SteamVR_Settings asset so it can be configured per project

View File

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

View File

@ -0,0 +1,106 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_RenderModel
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections.Generic;
namespace Valve.VR
{
[CustomEditor(typeof(SteamVR_RenderModel)), CanEditMultipleObjects]
public class SteamVR_RenderModelEditor : Editor
{
SerializedProperty script, index, modelOverride, shader, verbose, createComponents, updateDynamically;
static string[] renderModelNames;
int renderModelIndex;
void OnEnable()
{
script = serializedObject.FindProperty("m_Script");
index = serializedObject.FindProperty("index");
modelOverride = serializedObject.FindProperty("modelOverride");
shader = serializedObject.FindProperty("shader");
verbose = serializedObject.FindProperty("verbose");
createComponents = serializedObject.FindProperty("createComponents");
updateDynamically = serializedObject.FindProperty("updateDynamically");
// Load render model names if necessary.
if (renderModelNames == null)
{
renderModelNames = LoadRenderModelNames();
}
// Update renderModelIndex based on current modelOverride value.
if (modelOverride.stringValue != "")
{
for (int i = 0; i < renderModelNames.Length; i++)
{
if (modelOverride.stringValue == renderModelNames[i])
{
renderModelIndex = i;
break;
}
}
}
}
static string[] LoadRenderModelNames()
{
var results = new List<string>();
results.Add("None");
using (var holder = new SteamVR_RenderModel.RenderModelInterfaceHolder())
{
var renderModels = holder.instance;
if (renderModels != null)
{
uint count = renderModels.GetRenderModelCount();
for (uint i = 0; i < count; i++)
{
var buffer = new StringBuilder();
var requiredSize = renderModels.GetRenderModelName(i, buffer, 0);
if (requiredSize == 0)
continue;
buffer.EnsureCapacity((int)requiredSize);
renderModels.GetRenderModelName(i, buffer, requiredSize);
results.Add(buffer.ToString());
}
}
}
return results.ToArray();
}
public override void OnInspectorGUI()
{
serializedObject.Update();
EditorGUILayout.PropertyField(script);
EditorGUILayout.PropertyField(index);
//EditorGUILayout.PropertyField(modelOverride);
GUILayout.BeginHorizontal();
GUILayout.Label(new GUIContent("Model Override", SteamVR_RenderModel.modelOverrideWarning));
var selected = EditorGUILayout.Popup(renderModelIndex, renderModelNames);
if (selected != renderModelIndex)
{
renderModelIndex = selected;
modelOverride.stringValue = (selected > 0) ? renderModelNames[selected] : "";
}
GUILayout.EndHorizontal();
EditorGUILayout.PropertyField(shader);
EditorGUILayout.PropertyField(verbose);
EditorGUILayout.PropertyField(createComponents);
EditorGUILayout.PropertyField(updateDynamically);
serializedObject.ApplyModifiedProperties();
}
}
}

View File

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

View File

@ -0,0 +1,383 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Custom inspector display for SteamVR_Skybox
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.Text;
using System.Collections.Generic;
using Valve.VR;
using System.IO;
namespace Valve.VR
{
[CustomEditor(typeof(SteamVR_Skybox)), CanEditMultipleObjects]
public class SteamVR_SkyboxEditor : Editor
{
private const string nameFormat = "{0}/{1}-{2}.png";
private const string helpText = "Take snapshot will use the current " +
"position and rotation to capture six directional screenshots to use as this " +
"skybox's textures. Note: This skybox is only used to override what shows up " +
"in the compositor (e.g. when loading levels). Add a Camera component to this " +
"object to override default settings like which layers to render. Additionally, " +
"by specifying your own targetTexture, you can control the size of the textures " +
"and other properties like antialiasing. Don't forget to disable the camera.\n\n" +
"For stereo screenshots, a panorama is render for each eye using the specified " +
"ipd (in millimeters) broken up into segments cellSize pixels square to optimize " +
"generation.\n(32x32 takes about 10 seconds depending on scene complexity, 16x16 " +
"takes around a minute, while will 8x8 take several minutes.)\n\nTo test, hit " +
"play then pause - this will activate the skybox settings, and then drop you to " +
"the compositor where the skybox is rendered.";
public override void OnInspectorGUI()
{
DrawDefaultInspector();
EditorGUILayout.HelpBox(helpText, MessageType.Info);
if (GUILayout.Button("Take snapshot"))
{
var directions = new Quaternion[] {
Quaternion.LookRotation(Vector3.forward),
Quaternion.LookRotation(Vector3.back),
Quaternion.LookRotation(Vector3.left),
Quaternion.LookRotation(Vector3.right),
Quaternion.LookRotation(Vector3.up, Vector3.back),
Quaternion.LookRotation(Vector3.down, Vector3.forward)
};
Camera tempCamera = null;
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
if (!AssetDatabase.IsValidFolder(assetPath))
{
var guid = AssetDatabase.CreateFolder(scenePath, sceneName);
assetPath = AssetDatabase.GUIDToAssetPath(guid);
}
var camera = target.GetComponent<Camera>();
if (camera == null)
{
if (tempCamera == null)
tempCamera = new GameObject().AddComponent<Camera>();
camera = tempCamera;
}
var targetTexture = camera.targetTexture;
if (camera.targetTexture == null)
{
targetTexture = new RenderTexture(1024, 1024, 24);
targetTexture.antiAliasing = 8;
camera.targetTexture = targetTexture;
}
var oldPosition = target.transform.localPosition;
var oldRotation = target.transform.localRotation;
var baseRotation = target.transform.rotation;
var t = camera.transform;
t.position = target.transform.position;
camera.orthographic = false;
camera.fieldOfView = 90;
for (int i = 0; i < directions.Length; i++)
{
t.rotation = baseRotation * directions[i];
camera.Render();
// Copy to texture and save to disk.
RenderTexture.active = targetTexture;
var texture = new Texture2D(targetTexture.width, targetTexture.height, TextureFormat.ARGB32, false);
texture.ReadPixels(new Rect(0, 0, texture.width, texture.height), 0, 0);
texture.Apply();
RenderTexture.active = null;
var assetName = string.Format(nameFormat, assetPath, target.name, i);
System.IO.File.WriteAllBytes(assetName, texture.EncodeToPNG());
}
if (camera != tempCamera)
{
target.transform.localPosition = oldPosition;
target.transform.localRotation = oldRotation;
}
}
if (tempCamera != null)
{
Object.DestroyImmediate(tempCamera.gameObject);
}
// Now that everything has be written out, reload the associated assets and assign them.
AssetDatabase.Refresh();
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
for (int i = 0; i < directions.Length; i++)
{
var assetName = string.Format(nameFormat, assetPath, target.name, i);
var importer = AssetImporter.GetAtPath(assetName) as TextureImporter;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
importer.textureFormat = TextureImporterFormat.RGB24;
#else
importer.textureCompression = TextureImporterCompression.Uncompressed;
#endif
importer.wrapMode = TextureWrapMode.Clamp;
importer.mipmapEnabled = false;
importer.SaveAndReimport();
var texture = AssetDatabase.LoadAssetAtPath<Texture>(assetName);
target.SetTextureByIndex(i, texture);
}
}
}
else if (GUILayout.Button("Take stereo snapshot"))
{
const int width = 4096;
const int height = width / 2;
const int halfHeight = height / 2;
var textures = new Texture2D[] {
new Texture2D(width, height, TextureFormat.ARGB32, false),
new Texture2D(width, height, TextureFormat.ARGB32, false) };
var timer = new System.Diagnostics.Stopwatch();
Camera tempCamera = null;
foreach (SteamVR_Skybox target in targets)
{
timer.Start();
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
if (!AssetDatabase.IsValidFolder(assetPath))
{
var guid = AssetDatabase.CreateFolder(scenePath, sceneName);
assetPath = AssetDatabase.GUIDToAssetPath(guid);
}
var camera = target.GetComponent<Camera>();
if (camera == null)
{
if (tempCamera == null)
tempCamera = new GameObject().AddComponent<Camera>();
camera = tempCamera;
}
var fx = camera.gameObject.AddComponent<SteamVR_SphericalProjection>();
var oldTargetTexture = camera.targetTexture;
var oldOrthographic = camera.orthographic;
var oldFieldOfView = camera.fieldOfView;
var oldAspect = camera.aspect;
var oldPosition = target.transform.localPosition;
var oldRotation = target.transform.localRotation;
var basePosition = target.transform.position;
var baseRotation = target.transform.rotation;
var transform = camera.transform;
int cellSize = int.Parse(target.StereoCellSize.ToString().Substring(1));
float ipd = target.StereoIpdMm / 1000.0f;
int vTotal = halfHeight / cellSize;
float dv = 90.0f / vTotal; // vertical degrees per segment
float dvHalf = dv / 2.0f;
var targetTexture = new RenderTexture(cellSize, cellSize, 24);
targetTexture.wrapMode = TextureWrapMode.Clamp;
targetTexture.antiAliasing = 8;
camera.fieldOfView = dv;
camera.orthographic = false;
camera.targetTexture = targetTexture;
// Render sections of a sphere using a rectilinear projection
// and resample using a sphereical projection into a single panorama
// texture per eye. We break into sections in order to keep the eye
// separation similar around the sphere. Rendering alternates between
// top and bottom sections, sweeping horizontally around the sphere,
// alternating left and right eyes.
for (int v = 0; v < vTotal; v++)
{
var pitch = 90.0f - (v * dv) - dvHalf;
var uTotal = width / targetTexture.width;
var du = 360.0f / uTotal; // horizontal degrees per segment
var duHalf = du / 2.0f;
var vTarget = v * halfHeight / vTotal;
for (int i = 0; i < 2; i++) // top, bottom
{
if (i == 1)
{
pitch = -pitch;
vTarget = height - vTarget - cellSize;
}
for (int u = 0; u < uTotal; u++)
{
var yaw = -180.0f + (u * du) + duHalf;
var uTarget = u * width / uTotal;
var xOffset = -ipd / 2 * Mathf.Cos(pitch * Mathf.Deg2Rad);
for (int j = 0; j < 2; j++) // left, right
{
var texture = textures[j];
if (j == 1)
{
xOffset = -xOffset;
}
var offset = baseRotation * Quaternion.Euler(0, yaw, 0) * new Vector3(xOffset, 0, 0);
transform.position = basePosition + offset;
var direction = Quaternion.Euler(pitch, yaw, 0.0f);
transform.rotation = baseRotation * direction;
// vector pointing to center of this section
var N = direction * Vector3.forward;
// horizontal span of this section in degrees
var phi0 = yaw - (du / 2);
var phi1 = phi0 + du;
// vertical span of this section in degrees
var theta0 = pitch + (dv / 2);
var theta1 = theta0 - dv;
var midPhi = (phi0 + phi1) / 2;
var baseTheta = Mathf.Abs(theta0) < Mathf.Abs(theta1) ? theta0 : theta1;
// vectors pointing to corners of image closes to the equator
var V00 = Quaternion.Euler(baseTheta, phi0, 0.0f) * Vector3.forward;
var V01 = Quaternion.Euler(baseTheta, phi1, 0.0f) * Vector3.forward;
// vectors pointing to top and bottom midsection of image
var V0M = Quaternion.Euler(theta0, midPhi, 0.0f) * Vector3.forward;
var V1M = Quaternion.Euler(theta1, midPhi, 0.0f) * Vector3.forward;
// intersection points for each of the above
var P00 = V00 / Vector3.Dot(V00, N);
var P01 = V01 / Vector3.Dot(V01, N);
var P0M = V0M / Vector3.Dot(V0M, N);
var P1M = V1M / Vector3.Dot(V1M, N);
// calculate basis vectors for plane
var P00_P01 = P01 - P00;
var P0M_P1M = P1M - P0M;
var uMag = P00_P01.magnitude;
var vMag = P0M_P1M.magnitude;
var uScale = 1.0f / uMag;
var vScale = 1.0f / vMag;
var uAxis = P00_P01 * uScale;
var vAxis = P0M_P1M * vScale;
// update material constant buffer
fx.Set(N, phi0, phi1, theta0, theta1,
uAxis, P00, uScale,
vAxis, P0M, vScale);
camera.aspect = uMag / vMag;
camera.Render();
RenderTexture.active = targetTexture;
texture.ReadPixels(new Rect(0, 0, targetTexture.width, targetTexture.height), uTarget, vTarget);
RenderTexture.active = null;
}
}
}
}
// Save textures to disk.
for (int i = 0; i < 2; i++)
{
var texture = textures[i];
texture.Apply();
var assetName = string.Format(nameFormat, assetPath, target.name, i);
File.WriteAllBytes(assetName, texture.EncodeToPNG());
}
// Cleanup.
if (camera != tempCamera)
{
camera.targetTexture = oldTargetTexture;
camera.orthographic = oldOrthographic;
camera.fieldOfView = oldFieldOfView;
camera.aspect = oldAspect;
target.transform.localPosition = oldPosition;
target.transform.localRotation = oldRotation;
}
else
{
tempCamera.targetTexture = null;
}
DestroyImmediate(targetTexture);
DestroyImmediate(fx);
timer.Stop();
Debug.Log(string.Format("<b>[SteamVR]</b> Screenshot took {0} seconds.", timer.Elapsed));
}
if (tempCamera != null)
{
DestroyImmediate(tempCamera.gameObject);
}
DestroyImmediate(textures[0]);
DestroyImmediate(textures[1]);
// Now that everything has be written out, reload the associated assets and assign them.
AssetDatabase.Refresh();
foreach (SteamVR_Skybox target in targets)
{
var targetScene = target.gameObject.scene;
var sceneName = Path.GetFileNameWithoutExtension(targetScene.path);
var scenePath = Path.GetDirectoryName(targetScene.path);
var assetPath = scenePath + "/" + sceneName;
for (int i = 0; i < 2; i++)
{
var assetName = string.Format(nameFormat, assetPath, target.name, i);
var importer = AssetImporter.GetAtPath(assetName) as TextureImporter;
importer.mipmapEnabled = false;
importer.wrapMode = TextureWrapMode.Repeat;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
importer.SetPlatformTextureSettings("Standalone", width, TextureImporterFormat.RGB24);
#else
var settings = importer.GetPlatformTextureSettings("Standalone");
settings.textureCompression = TextureImporterCompression.Uncompressed;
settings.maxTextureSize = width;
importer.SetPlatformTextureSettings(settings);
#endif
importer.SaveAndReimport();
var texture = AssetDatabase.LoadAssetAtPath<Texture2D>(assetName);
target.SetTextureByIndex(i, texture);
}
}
}
}
}
}

View File

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

View File

@ -0,0 +1,692 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Prompt developers to use settings most compatible with SteamVR.
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
namespace Valve.VR
{
[InitializeOnLoad]
public class SteamVR_UnitySettingsWindow : EditorWindow
{
const bool forceShow = false; // Set to true to get the dialog to show back up in the case you clicked Ignore All.
const string ignore = "ignore.";
const string useRecommended = "Use recommended ({0})";
const string currentValue = " (current = {0})";
const string buildTarget = "Build Target";
const string showUnitySplashScreen = "Show Unity Splashscreen";
const string defaultIsFullScreen = "Default is Fullscreen";
const string defaultScreenSize = "Default Screen Size";
const string runInBackground = "Run In Background";
const string displayResolutionDialog = "Display Resolution Dialog";
const string resizableWindow = "Resizable Window";
const string fullscreenMode = "D3D11 Fullscreen Mode";
const string visibleInBackground = "Visible In Background";
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
const string renderingPath = "Rendering Path";
#endif
const string colorSpace = "Color Space";
const string gpuSkinning = "GPU Skinning";
#if false // skyboxes are currently broken
const string singlePassStereoRendering = "Single-Pass Stereo Rendering";
#endif
const BuildTarget recommended_BuildTarget = BuildTarget.StandaloneWindows64;
const bool recommended_ShowUnitySplashScreen = false;
const bool recommended_DefaultIsFullScreen = false;
const int recommended_DefaultScreenWidth = 1024;
const int recommended_DefaultScreenHeight = 768;
const bool recommended_RunInBackground = true;
#if !UNITY_2019_1_OR_NEWER
const ResolutionDialogSetting recommended_DisplayResolutionDialog = ResolutionDialogSetting.HiddenByDefault;
#endif
const bool recommended_ResizableWindow = true;
const D3D11FullscreenMode recommended_FullscreenMode = D3D11FullscreenMode.FullscreenWindow;
const bool recommended_VisibleInBackground = true;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
const RenderingPath recommended_RenderPath = RenderingPath.Forward;
#endif
const ColorSpace recommended_ColorSpace = ColorSpace.Linear;
const bool recommended_GpuSkinning = true;
#if false
const bool recommended_SinglePassStereoRendering = true;
#endif
#if UNITY_2018_1_OR_NEWER
const FullScreenMode recommended_FullScreenMode = FullScreenMode.FullScreenWindow;
#endif
static SteamVR_UnitySettingsWindow window;
static SteamVR_UnitySettingsWindow()
{
EditorApplication.update += Update;
}
static void Update()
{
bool show =
(!EditorPrefs.HasKey(ignore + buildTarget) &&
EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget) ||
(!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen) ||
#else
PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen) ||
#endif
#if UNITY_2018_1_OR_NEWER
(!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.fullScreenMode != recommended_FullScreenMode) ||
#else
(!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen) ||
(!EditorPrefs.HasKey(ignore + fullscreenMode) &&
PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode) ||
#endif
(!EditorPrefs.HasKey(ignore + defaultScreenSize) &&
(PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight)) ||
(!EditorPrefs.HasKey(ignore + runInBackground) &&
PlayerSettings.runInBackground != recommended_RunInBackground) ||
#if !UNITY_2019_1_OR_NEWER
(!EditorPrefs.HasKey(ignore + displayResolutionDialog) &&
PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog) ||
#endif
(!EditorPrefs.HasKey(ignore + resizableWindow) &&
PlayerSettings.resizableWindow != recommended_ResizableWindow) ||
(!EditorPrefs.HasKey(ignore + visibleInBackground) &&
PlayerSettings.visibleInBackground != recommended_VisibleInBackground) ||
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
(!EditorPrefs.HasKey(ignore + renderingPath) &&
PlayerSettings.renderingPath != recommended_RenderPath) ||
#endif
(!EditorPrefs.HasKey(ignore + colorSpace) &&
PlayerSettings.colorSpace != recommended_ColorSpace) ||
(!EditorPrefs.HasKey(ignore + gpuSkinning) &&
PlayerSettings.gpuSkinning != recommended_GpuSkinning) ||
#if false
(!EditorPrefs.HasKey(ignore + singlePassStereoRendering) &&
PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering) ||
#endif
forceShow;
if (show)
{
window = GetWindow<SteamVR_UnitySettingsWindow>(true);
window.minSize = new Vector2(320, 440);
//window.title = "SteamVR";
}
string[] dlls = new string[]
{
"Plugins/x86/openvr_api.dll",
"Plugins/x86_64/openvr_api.dll"
};
foreach (string path in dlls)
{
if (!File.Exists(Application.dataPath + "/" + path))
continue;
if (AssetDatabase.DeleteAsset("Assets/" + path))
Debug.Log("<b>[SteamVR Setup]</b> Deleting " + path);
else
{
Debug.Log("<b>[SteamVR Setup]</b> " + path + " in use; cannot delete. Please restart Unity to complete upgrade.");
}
}
EditorApplication.update -= Update;
}
Vector2 scrollPosition;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
public void OnGUI()
{
var resourcePath = GetResourcePath();
var logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
EditorGUILayout.HelpBox("Recommended project settings for SteamVR:", MessageType.Warning);
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
int numItems = 0;
if (!EditorPrefs.HasKey(ignore + buildTarget) &&
EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget)
{
++numItems;
GUILayout.Label(buildTarget + string.Format(currentValue, EditorUserBuildSettings.activeBuildTarget));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_BuildTarget)))
{
#if (UNITY_5_5 || UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorUserBuildSettings.SwitchActiveBuildTarget(recommended_BuildTarget);
#else
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, recommended_BuildTarget);
#endif
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + buildTarget, true);
}
GUILayout.EndHorizontal();
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen)
{
++numItems;
GUILayout.Label(showUnitySplashScreen + string.Format(currentValue, PlayerSettings.showUnitySplashScreen));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ShowUnitySplashScreen)))
{
PlayerSettings.showUnitySplashScreen = recommended_ShowUnitySplashScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
}
GUILayout.EndHorizontal();
}
#else
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen) &&
PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen)
{
++numItems;
GUILayout.Label(showUnitySplashScreen + string.Format(currentValue, PlayerSettings.SplashScreen.show));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ShowUnitySplashScreen)))
{
PlayerSettings.SplashScreen.show = recommended_ShowUnitySplashScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
}
GUILayout.EndHorizontal();
}
#endif
#if UNITY_2018_1_OR_NEWER
#else
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen)
{
++numItems;
GUILayout.Label(defaultIsFullScreen + string.Format(currentValue, PlayerSettings.defaultIsFullScreen));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_DefaultIsFullScreen)))
{
PlayerSettings.defaultIsFullScreen = recommended_DefaultIsFullScreen;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + defaultIsFullScreen, true);
}
GUILayout.EndHorizontal();
}
#endif
if (!EditorPrefs.HasKey(ignore + defaultScreenSize) &&
(PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight))
{
++numItems;
GUILayout.Label(defaultScreenSize + string.Format(" ({0}x{1})", PlayerSettings.defaultScreenWidth, PlayerSettings.defaultScreenHeight));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format("Use recommended ({0}x{1})", recommended_DefaultScreenWidth, recommended_DefaultScreenHeight)))
{
PlayerSettings.defaultScreenWidth = recommended_DefaultScreenWidth;
PlayerSettings.defaultScreenHeight = recommended_DefaultScreenHeight;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + defaultScreenSize, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + runInBackground) &&
PlayerSettings.runInBackground != recommended_RunInBackground)
{
++numItems;
GUILayout.Label(runInBackground + string.Format(currentValue, PlayerSettings.runInBackground));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_RunInBackground)))
{
PlayerSettings.runInBackground = recommended_RunInBackground;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + runInBackground, true);
}
GUILayout.EndHorizontal();
}
#if !UNITY_2019_1_OR_NEWER
if (!EditorPrefs.HasKey(ignore + displayResolutionDialog) &&
PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog)
{
++numItems;
GUILayout.Label(displayResolutionDialog + string.Format(currentValue, PlayerSettings.displayResolutionDialog));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_DisplayResolutionDialog)))
{
PlayerSettings.displayResolutionDialog = recommended_DisplayResolutionDialog;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + displayResolutionDialog, true);
}
GUILayout.EndHorizontal();
}
#endif
if (!EditorPrefs.HasKey(ignore + resizableWindow) &&
PlayerSettings.resizableWindow != recommended_ResizableWindow)
{
++numItems;
GUILayout.Label(resizableWindow + string.Format(currentValue, PlayerSettings.resizableWindow));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ResizableWindow)))
{
PlayerSettings.resizableWindow = recommended_ResizableWindow;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + resizableWindow, true);
}
GUILayout.EndHorizontal();
}
#if UNITY_2018_1_OR_NEWER
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen) &&
PlayerSettings.fullScreenMode != recommended_FullScreenMode)
#else
if (!EditorPrefs.HasKey(ignore + fullscreenMode) &&
PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode)
#endif
{
++numItems;
#if UNITY_2018_1_OR_NEWER
GUILayout.Label(fullscreenMode + string.Format(currentValue, PlayerSettings.fullScreenMode));
#else
GUILayout.Label(fullscreenMode + string.Format(currentValue, PlayerSettings.d3d11FullscreenMode));
#endif
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_FullscreenMode)))
{
#if UNITY_2018_1_OR_NEWER
PlayerSettings.fullScreenMode = recommended_FullScreenMode;
#else
PlayerSettings.d3d11FullscreenMode = recommended_FullscreenMode;
#endif
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + fullscreenMode, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + visibleInBackground) &&
PlayerSettings.visibleInBackground != recommended_VisibleInBackground)
{
++numItems;
GUILayout.Label(visibleInBackground + string.Format(currentValue, PlayerSettings.visibleInBackground));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_VisibleInBackground)))
{
PlayerSettings.visibleInBackground = recommended_VisibleInBackground;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + visibleInBackground, true);
}
GUILayout.EndHorizontal();
}
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + renderingPath) &&
PlayerSettings.renderingPath != recommended_RenderPath)
{
++numItems;
GUILayout.Label(renderingPath + string.Format(currentValue, PlayerSettings.renderingPath));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_RenderPath) + " - required for MSAA"))
{
PlayerSettings.renderingPath = recommended_RenderPath;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + renderingPath, true);
}
GUILayout.EndHorizontal();
}
#endif
if (!EditorPrefs.HasKey(ignore + colorSpace) &&
PlayerSettings.colorSpace != recommended_ColorSpace)
{
++numItems;
GUILayout.Label(colorSpace + string.Format(currentValue, PlayerSettings.colorSpace));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_ColorSpace) + " - requires reloading scene"))
{
PlayerSettings.colorSpace = recommended_ColorSpace;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + colorSpace, true);
}
GUILayout.EndHorizontal();
}
if (!EditorPrefs.HasKey(ignore + gpuSkinning) &&
PlayerSettings.gpuSkinning != recommended_GpuSkinning)
{
++numItems;
GUILayout.Label(gpuSkinning + string.Format(currentValue, PlayerSettings.gpuSkinning));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_GpuSkinning)))
{
PlayerSettings.gpuSkinning = recommended_GpuSkinning;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + gpuSkinning, true);
}
GUILayout.EndHorizontal();
}
#if false
if (!EditorPrefs.HasKey(ignore + singlePassStereoRendering) &&
PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering)
{
++numItems;
GUILayout.Label(singlePassStereoRendering + string.Format(currentValue, PlayerSettings.singlePassStereoRendering));
GUILayout.BeginHorizontal();
if (GUILayout.Button(string.Format(useRecommended, recommended_SinglePassStereoRendering)))
{
PlayerSettings.singlePassStereoRendering = recommended_SinglePassStereoRendering;
}
GUILayout.FlexibleSpace();
if (GUILayout.Button("Ignore"))
{
EditorPrefs.SetBool(ignore + singlePassStereoRendering, true);
}
GUILayout.EndHorizontal();
}
#endif
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Clear All Ignores"))
{
EditorPrefs.DeleteKey(ignore + buildTarget);
EditorPrefs.DeleteKey(ignore + showUnitySplashScreen);
EditorPrefs.DeleteKey(ignore + defaultIsFullScreen);
EditorPrefs.DeleteKey(ignore + defaultScreenSize);
EditorPrefs.DeleteKey(ignore + runInBackground);
EditorPrefs.DeleteKey(ignore + displayResolutionDialog);
EditorPrefs.DeleteKey(ignore + resizableWindow);
EditorPrefs.DeleteKey(ignore + fullscreenMode);
EditorPrefs.DeleteKey(ignore + visibleInBackground);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorPrefs.DeleteKey(ignore + renderingPath);
#endif
EditorPrefs.DeleteKey(ignore + colorSpace);
EditorPrefs.DeleteKey(ignore + gpuSkinning);
#if false
EditorPrefs.DeleteKey(ignore + singlePassStereoRendering);
#endif
}
GUILayout.EndHorizontal();
GUILayout.EndScrollView();
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
if (numItems > 0)
{
if (GUILayout.Button("Accept All"))
{
// Only set those that have not been explicitly ignored.
if (!EditorPrefs.HasKey(ignore + buildTarget))
#if (UNITY_5_5 || UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
EditorUserBuildSettings.SwitchActiveBuildTarget(recommended_BuildTarget);
#else
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, recommended_BuildTarget);
#endif
if (!EditorPrefs.HasKey(ignore + showUnitySplashScreen))
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
PlayerSettings.showUnitySplashScreen = recommended_ShowUnitySplashScreen;
#else
PlayerSettings.SplashScreen.show = recommended_ShowUnitySplashScreen;
#endif
#if UNITY_2018_1_OR_NEWER
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen))
PlayerSettings.fullScreenMode = recommended_FullScreenMode;
#else
if (!EditorPrefs.HasKey(ignore + defaultIsFullScreen))
PlayerSettings.defaultIsFullScreen = recommended_DefaultIsFullScreen;
if (!EditorPrefs.HasKey(ignore + fullscreenMode))
PlayerSettings.d3d11FullscreenMode = recommended_FullscreenMode;
#endif
if (!EditorPrefs.HasKey(ignore + defaultScreenSize))
{
PlayerSettings.defaultScreenWidth = recommended_DefaultScreenWidth;
PlayerSettings.defaultScreenHeight = recommended_DefaultScreenHeight;
}
if (!EditorPrefs.HasKey(ignore + runInBackground))
PlayerSettings.runInBackground = recommended_RunInBackground;
#if !UNITY_2019_1_OR_NEWER
if (!EditorPrefs.HasKey(ignore + displayResolutionDialog))
PlayerSettings.displayResolutionDialog = recommended_DisplayResolutionDialog;
#endif
if (!EditorPrefs.HasKey(ignore + resizableWindow))
PlayerSettings.resizableWindow = recommended_ResizableWindow;
if (!EditorPrefs.HasKey(ignore + visibleInBackground))
PlayerSettings.visibleInBackground = recommended_VisibleInBackground;
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (!EditorPrefs.HasKey(ignore + renderingPath))
PlayerSettings.renderingPath = recommended_RenderPath;
#endif
if (!EditorPrefs.HasKey(ignore + colorSpace))
PlayerSettings.colorSpace = recommended_ColorSpace;
if (!EditorPrefs.HasKey(ignore + gpuSkinning))
PlayerSettings.gpuSkinning = recommended_GpuSkinning;
#if false
if (!EditorPrefs.HasKey(ignore + singlePassStereoRendering))
PlayerSettings.singlePassStereoRendering = recommended_SinglePassStereoRendering;
#endif
EditorUtility.DisplayDialog("Accept All", "You made the right choice!", "Ok");
Close();
}
if (GUILayout.Button("Ignore All"))
{
if (EditorUtility.DisplayDialog("Ignore All", "Are you sure?", "Yes, Ignore All", "Cancel"))
{
// Only ignore those that do not currently match our recommended settings.
if (EditorUserBuildSettings.activeBuildTarget != recommended_BuildTarget)
EditorPrefs.SetBool(ignore + buildTarget, true);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (PlayerSettings.showUnitySplashScreen != recommended_ShowUnitySplashScreen)
#else
if (PlayerSettings.SplashScreen.show != recommended_ShowUnitySplashScreen)
#endif
EditorPrefs.SetBool(ignore + showUnitySplashScreen, true);
#if UNITY_2018_1_OR_NEWER
if (PlayerSettings.fullScreenMode != recommended_FullScreenMode)
{
EditorPrefs.SetBool(ignore + defaultIsFullScreen, true);
EditorPrefs.SetBool(ignore + fullscreenMode, true);
}
#else
if (PlayerSettings.defaultIsFullScreen != recommended_DefaultIsFullScreen)
EditorPrefs.SetBool(ignore + defaultIsFullScreen, true);
if (PlayerSettings.d3d11FullscreenMode != recommended_FullscreenMode)
EditorPrefs.SetBool(ignore + fullscreenMode, true);
#endif
if (PlayerSettings.defaultScreenWidth != recommended_DefaultScreenWidth ||
PlayerSettings.defaultScreenHeight != recommended_DefaultScreenHeight)
EditorPrefs.SetBool(ignore + defaultScreenSize, true);
if (PlayerSettings.runInBackground != recommended_RunInBackground)
EditorPrefs.SetBool(ignore + runInBackground, true);
#if !UNITY_2019_1_OR_NEWER
if (PlayerSettings.displayResolutionDialog != recommended_DisplayResolutionDialog)
EditorPrefs.SetBool(ignore + displayResolutionDialog, true);
#endif
if (PlayerSettings.resizableWindow != recommended_ResizableWindow)
EditorPrefs.SetBool(ignore + resizableWindow, true);
if (PlayerSettings.visibleInBackground != recommended_VisibleInBackground)
EditorPrefs.SetBool(ignore + visibleInBackground, true);
#if (UNITY_5_4 || UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0)
if (PlayerSettings.renderingPath != recommended_RenderPath)
EditorPrefs.SetBool(ignore + renderingPath, true);
#endif
if (PlayerSettings.colorSpace != recommended_ColorSpace)
EditorPrefs.SetBool(ignore + colorSpace, true);
if (PlayerSettings.gpuSkinning != recommended_GpuSkinning)
EditorPrefs.SetBool(ignore + gpuSkinning, true);
#if false
if (PlayerSettings.singlePassStereoRendering != recommended_SinglePassStereoRendering)
EditorPrefs.SetBool(ignore + singlePassStereoRendering, true);
#endif
Close();
}
}
}
else if (GUILayout.Button("Close"))
{
Close();
}
GUILayout.EndHorizontal();
}
}
}

View File

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

View File

@ -0,0 +1,180 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Notify developers when a new version of the plugin is available.
//
//=============================================================================
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Text.RegularExpressions;
#if UNITY_2018_3_OR_NEWER
#pragma warning disable CS0618
#endif
namespace Valve.VR
{
[InitializeOnLoad]
public class SteamVR_Update : EditorWindow
{
const string currentVersion = "2.1";
const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt";
const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt";
const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin";
const string doNotShowKey = "SteamVR.DoNotShow.v{0}";
static bool gotVersion = false;
static WWW wwwVersion, wwwNotes;
static string version, notes;
static SteamVR_Update window;
static SteamVR_Update()
{
EditorApplication.update += Update;
}
static void Update()
{
if (!gotVersion)
{
if (wwwVersion == null)
wwwVersion = new WWW(versionUrl);
if (!wwwVersion.isDone)
return;
if (UrlSuccess(wwwVersion))
version = wwwVersion.text;
wwwVersion = null;
gotVersion = true;
if (ShouldDisplay())
{
var url = string.Format(notesUrl, version);
wwwNotes = new WWW(url);
window = GetWindow<SteamVR_Update>(true);
window.minSize = new Vector2(320, 440);
//window.title = "SteamVR";
}
}
if (wwwNotes != null)
{
if (!wwwNotes.isDone)
return;
if (UrlSuccess(wwwNotes))
notes = wwwNotes.text;
wwwNotes = null;
if (notes != "")
window.Repaint();
}
EditorApplication.update -= Update;
}
static bool UrlSuccess(WWW www)
{
if (!string.IsNullOrEmpty(www.error))
return false;
if (Regex.IsMatch(www.text, "404 not found", RegexOptions.IgnoreCase))
return false;
return true;
}
static bool ShouldDisplay()
{
if (string.IsNullOrEmpty(version))
return false;
if (version == currentVersion)
return false;
if (EditorPrefs.HasKey(string.Format(doNotShowKey, version)))
return false;
// parse to see if newer (e.g. 1.0.4 vs 1.0.3)
var versionSplit = version.Split('.');
var currentVersionSplit = currentVersion.Split('.');
for (int i = 0; i < versionSplit.Length && i < currentVersionSplit.Length; i++)
{
int versionValue, currentVersionValue;
if (int.TryParse(versionSplit[i], out versionValue) &&
int.TryParse(currentVersionSplit[i], out currentVersionValue))
{
if (versionValue > currentVersionValue)
return true;
if (versionValue < currentVersionValue)
return false;
}
}
// same up to this point, now differentiate based on number of sub values (e.g. 1.0.4.1 vs 1.0.4)
if (versionSplit.Length <= currentVersionSplit.Length)
return false;
return true;
}
Vector2 scrollPosition;
bool toggleState;
string GetResourcePath()
{
var ms = MonoScript.FromScriptableObject(this);
var path = AssetDatabase.GetAssetPath(ms);
path = Path.GetDirectoryName(path);
return path.Substring(0, path.Length - "Editor".Length) + "Textures/";
}
public void OnGUI()
{
EditorGUILayout.HelpBox("A new version of the SteamVR plugin is available!", MessageType.Warning);
var resourcePath = GetResourcePath();
var logo = AssetDatabase.LoadAssetAtPath<Texture2D>(resourcePath + "logo.png");
var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box);
if (logo)
GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit);
scrollPosition = GUILayout.BeginScrollView(scrollPosition);
GUILayout.Label("Current version: " + currentVersion);
GUILayout.Label("New version: " + version);
if (notes != "")
{
GUILayout.Label("Release notes:");
EditorGUILayout.HelpBox(notes, MessageType.Info);
}
GUILayout.EndScrollView();
GUILayout.FlexibleSpace();
if (GUILayout.Button("Get Latest Version"))
{
Application.OpenURL(pluginUrl);
}
EditorGUI.BeginChangeCheck();
var doNotShow = GUILayout.Toggle(toggleState, "Do not prompt for this version again.");
if (EditorGUI.EndChangeCheck())
{
toggleState = doNotShow;
var key = string.Format(doNotShowKey, version);
if (doNotShow)
EditorPrefs.SetBool(key, true);
else
EditorPrefs.DeleteKey(key);
}
}
}
}
#if UNITY_2018_3_OR_NEWER
#pragma warning restore CS0618
#endif

View File

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

View File

@ -0,0 +1,26 @@
using UnityEditor;
using UnityEngine;
using System.CodeDom;
using Microsoft.CSharp;
using System.IO;
using System.CodeDom.Compiler;
using System.Linq;
using System.Collections.Generic;
using System.Reflection;
using System.Linq.Expressions;
using System;
namespace Valve.VR
{
[CustomPropertyDrawer(typeof(SteamVR_UpdateModes))]
public class SteamVR_UpdateModesEditor : PropertyDrawer
{
public override void OnGUI(Rect _position, SerializedProperty _property, GUIContent _label)
{
_property.intValue = EditorGUI.MaskField(_position, _label, _property.intValue, _property.enumNames);
}
}
}

View File

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

View File

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

View File

@ -0,0 +1,18 @@
using UnityEngine;
using System.Collections;
namespace Valve.VR
{
public class SteamVR_CameraHelper : MonoBehaviour
{
void Start()
{
#if OPENVR_XR_API && UNITY_LEGACY_INPUT_HELPERS
if (this.gameObject.GetComponent<UnityEngine.SpatialTracking.TrackedPoseDriver>() == null)
{
this.gameObject.AddComponent<UnityEngine.SpatialTracking.TrackedPoseDriver>();
}
#endif
}
}
}

View File

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

View File

@ -0,0 +1,35 @@
using UnityEngine;
using System.Collections;
namespace Valve.VR.Extras
{
/// <summary>
/// This is an example class of how to force steamvr initialization. You still need to have vr mode enabled
/// but you can have the top sdk set to None, then this script will force it to OpenVR after a second
/// </summary>
public class SteamVR_ForceSteamVRMode : MonoBehaviour
{
public GameObject vrCameraPrefab;
public GameObject[] disableObjectsOnLoad;
private IEnumerator Start()
{
yield return new WaitForSeconds(1f); // just here to show that you can wait a while.
SteamVR.Initialize(true);
while (SteamVR.initializedState != SteamVR.InitializedStates.InitializeSuccess)
yield return null;
for (int disableIndex = 0; disableIndex < disableObjectsOnLoad.Length; disableIndex++)
{
GameObject toDisable = disableObjectsOnLoad[disableIndex];
if (toDisable != null)
toDisable.SetActive(false);
}
GameObject.Instantiate(vrCameraPrefab);
}
}
}

View File

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

View File

@ -0,0 +1,459 @@
%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, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 1
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: 1
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: 256
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!1 &24851820
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 24851825}
- 33: {fileID: 24851824}
- 135: {fileID: 24851823}
- 23: {fileID: 24851822}
- 54: {fileID: 24851821}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!54 &24851821
Rigidbody:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 1
m_Constraints: 0
m_CollisionDetection: 0
--- !u!23 &24851822
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
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!135 &24851823
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Material: {fileID: 13400000, guid: 2e81b378186c0ed4c98c04cfd4096914, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &24851824
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &24851825
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.624, z: 2.68}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!1 &548674979
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 548674984}
- 20: {fileID: 548674983}
- 124: {fileID: 548674982}
- 92: {fileID: 548674981}
- 81: {fileID: 548674980}
m_Layer: 0
m_Name: Pancake Camera
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &548674980
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 548674979}
m_Enabled: 1
--- !u!92 &548674981
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 548674979}
m_Enabled: 1
--- !u!124 &548674982
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 548674979}
m_Enabled: 1
--- !u!20 &548674983
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 548674979}
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_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &548674984
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 548674979}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.49, y: 1.612, z: -1}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!1 &595728105
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 595728107}
- 114: {fileID: 595728106}
m_Layer: 0
m_Name: Loader
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &595728106
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 595728105}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c4bc5db9c652ff8408b7cda0197f87f1, type: 3}
m_Name:
m_EditorClassIdentifier:
vrCameraPrefab: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
disableObjectsOnLoad:
- {fileID: 548674979}
--- !u!4 &595728107
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 595728105}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -4.327, y: 1.612, z: -0.253}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
--- !u!1 &1548954329
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1548954331}
- 108: {fileID: 1548954330}
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 &1548954330
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
m_Enabled: 1
serializedVersion: 7
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_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1548954331
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
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_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1 &1578927695
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1578927699}
- 33: {fileID: 1578927698}
- 23: {fileID: 1578927697}
- 65: {fileID: 1578927696}
m_Layer: 0
m_Name: Floor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &1578927696
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 10, y: 0.1, z: 10.000001}
m_Center: {x: 0, y: -0.05, z: 0}
--- !u!23 &1578927697
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: b41d1116a101a84499296ce28d16e6b9, type: 2}
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!33 &1578927698
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1578927699
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 4, y: 3, z: 4}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9b1775e13a163e146930422a18e54bfc
timeCreated: 1539107812
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,83 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
namespace Valve.VR.Extras
{
public class SteamVR_GazeTracker : MonoBehaviour
{
public bool isInGaze = false;
public event GazeEventHandler GazeOn;
public event GazeEventHandler GazeOff;
public float gazeInCutoff = 0.15f;
public float gazeOutCutoff = 0.4f;
// Contains a HMD tracked object that we can use to find the user's gaze
protected Transform hmdTrackedObject = null;
public virtual void OnGazeOn(GazeEventArgs gazeEventArgs)
{
if (GazeOn != null)
GazeOn(this, gazeEventArgs);
}
public virtual void OnGazeOff(GazeEventArgs gazeEventArgs)
{
if (GazeOff != null)
GazeOff(this, gazeEventArgs);
}
protected virtual void Update()
{
// If we haven't set up hmdTrackedObject find what the user is looking at
if (hmdTrackedObject == null)
{
SteamVR_TrackedObject[] trackedObjects = FindObjectsOfType<SteamVR_TrackedObject>();
foreach (SteamVR_TrackedObject tracked in trackedObjects)
{
if (tracked.index == SteamVR_TrackedObject.EIndex.Hmd)
{
hmdTrackedObject = tracked.transform;
break;
}
}
}
if (hmdTrackedObject)
{
Ray ray = new Ray(hmdTrackedObject.position, hmdTrackedObject.forward);
Plane plane = new Plane(hmdTrackedObject.forward, transform.position);
float enter = 0.0f;
if (plane.Raycast(ray, out enter))
{
Vector3 intersect = hmdTrackedObject.position + hmdTrackedObject.forward * enter;
float dist = Vector3.Distance(intersect, transform.position);
//Debug.Log("Gaze dist = " + dist);
if (dist < gazeInCutoff && !isInGaze)
{
isInGaze = true;
GazeEventArgs gazeEventArgs;
gazeEventArgs.distance = dist;
OnGazeOn(gazeEventArgs);
}
else if (dist >= gazeOutCutoff && isInGaze)
{
isInGaze = false;
GazeEventArgs gazeEventArgs;
gazeEventArgs.distance = dist;
OnGazeOff(gazeEventArgs);
}
}
}
}
}
public struct GazeEventArgs
{
public float distance;
}
public delegate void GazeEventHandler(object sender, GazeEventArgs gazeEventArgs);
}

View File

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

View File

@ -0,0 +1,168 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
using UnityEngine;
using System.Collections;
namespace Valve.VR.Extras
{
public class SteamVR_LaserPointer : MonoBehaviour
{
public SteamVR_Behaviour_Pose pose;
//public SteamVR_Action_Boolean interactWithUI = SteamVR_Input.__actions_default_in_InteractUI;
public SteamVR_Action_Boolean interactWithUI = SteamVR_Input.GetBooleanAction("InteractUI");
public bool active = true;
public Color color;
public float thickness = 0.002f;
public Color clickColor = Color.green;
public GameObject holder;
public GameObject pointer;
bool isActive = false;
public bool addRigidBody = false;
public Transform reference;
public event PointerEventHandler PointerIn;
public event PointerEventHandler PointerOut;
public event PointerEventHandler PointerClick;
Transform previousContact = null;
private void Start()
{
if (pose == null)
pose = this.GetComponent<SteamVR_Behaviour_Pose>();
if (pose == null)
Debug.LogError("No SteamVR_Behaviour_Pose component found on this object", this);
if (interactWithUI == null)
Debug.LogError("No ui interaction action has been set on this component.", this);
holder = new GameObject();
holder.transform.parent = this.transform;
holder.transform.localPosition = Vector3.zero;
holder.transform.localRotation = Quaternion.identity;
pointer = GameObject.CreatePrimitive(PrimitiveType.Cube);
pointer.transform.parent = holder.transform;
pointer.transform.localScale = new Vector3(thickness, thickness, 100f);
pointer.transform.localPosition = new Vector3(0f, 0f, 50f);
pointer.transform.localRotation = Quaternion.identity;
BoxCollider collider = pointer.GetComponent<BoxCollider>();
if (addRigidBody)
{
if (collider)
{
collider.isTrigger = true;
}
Rigidbody rigidBody = pointer.AddComponent<Rigidbody>();
rigidBody.isKinematic = true;
}
else
{
if (collider)
{
Object.Destroy(collider);
}
}
Material newMaterial = new Material(Shader.Find("Unlit/Color"));
newMaterial.SetColor("_Color", color);
pointer.GetComponent<MeshRenderer>().material = newMaterial;
}
public virtual void OnPointerIn(PointerEventArgs e)
{
if (PointerIn != null)
PointerIn(this, e);
}
public virtual void OnPointerClick(PointerEventArgs e)
{
if (PointerClick != null)
PointerClick(this, e);
}
public virtual void OnPointerOut(PointerEventArgs e)
{
if (PointerOut != null)
PointerOut(this, e);
}
private void Update()
{
if (!isActive)
{
isActive = true;
this.transform.GetChild(0).gameObject.SetActive(true);
}
float dist = 100f;
Ray raycast = new Ray(transform.position, transform.forward);
RaycastHit hit;
bool bHit = Physics.Raycast(raycast, out hit);
if (previousContact && previousContact != hit.transform)
{
PointerEventArgs args = new PointerEventArgs();
args.fromInputSource = pose.inputSource;
args.distance = 0f;
args.flags = 0;
args.target = previousContact;
OnPointerOut(args);
previousContact = null;
}
if (bHit && previousContact != hit.transform)
{
PointerEventArgs argsIn = new PointerEventArgs();
argsIn.fromInputSource = pose.inputSource;
argsIn.distance = hit.distance;
argsIn.flags = 0;
argsIn.target = hit.transform;
OnPointerIn(argsIn);
previousContact = hit.transform;
}
if (!bHit)
{
previousContact = null;
}
if (bHit && hit.distance < 100f)
{
dist = hit.distance;
}
if (bHit && interactWithUI.GetStateUp(pose.inputSource))
{
PointerEventArgs argsClick = new PointerEventArgs();
argsClick.fromInputSource = pose.inputSource;
argsClick.distance = hit.distance;
argsClick.flags = 0;
argsClick.target = hit.transform;
OnPointerClick(argsClick);
}
if (interactWithUI != null && interactWithUI.GetState(pose.inputSource))
{
pointer.transform.localScale = new Vector3(thickness * 5f, thickness * 5f, dist);
pointer.GetComponent<MeshRenderer>().material.color = clickColor;
}
else
{
pointer.transform.localScale = new Vector3(thickness, thickness, dist);
pointer.GetComponent<MeshRenderer>().material.color = color;
}
pointer.transform.localPosition = new Vector3(0f, 0f, dist / 2f);
}
}
public struct PointerEventArgs
{
public SteamVR_Input_Sources fromInputSource;
public uint flags;
public float distance;
public Transform target;
}
public delegate void PointerEventHandler(object sender, PointerEventArgs e);
}

View File

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

View File

@ -0,0 +1,586 @@
%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, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 1
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: 1
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: 256
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!1 &24851820
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 24851825}
- 33: {fileID: 24851824}
- 135: {fileID: 24851823}
- 23: {fileID: 24851822}
- 54: {fileID: 24851821}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!54 &24851821
Rigidbody:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 1
m_Constraints: 0
m_CollisionDetection: 0
--- !u!23 &24851822
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
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!135 &24851823
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Material: {fileID: 13400000, guid: 2e81b378186c0ed4c98c04cfd4096914, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &24851824
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &24851825
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.624, z: 2.68}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!43 &33627688
Mesh:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
serializedVersion: 8
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexBuffer: 000004000100010004000500010005000200020005000600020006000300030006000700030007000000000007000400
m_Skin: []
m_VertexData:
m_CurrentChannels: 13
m_VertexCount: 8
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 288
_typelessdata: 0000c03f0ad7233c000090bf000000000000803f0000803f0000803f00000000000000000000c0bf0ad7233c000090bf000000000000803f0000803f0000803f0000803f000000000000c0bf0ad7233c0000903f000000000000803f0000803f0000803f00000000000000000000c03f0ad7233c0000903f000000000000803f0000803f0000803f0000803f000000003333d33f0ad7233c3333a3bf000000000000803f0000803f00000000000000000000803f3333d3bf0ad7233c3333a3bf000000000000803f0000803f000000000000803f0000803f3333d3bf0ad7233c3333a33f000000000000803f0000803f00000000000000000000803f3333d33f0ad7233c3333a33f000000000000803f0000803f000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshOptimized: 0
--- !u!21 &1231479188
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Sprites/Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: PixelSnap
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!1001 &1474170597
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3380982, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 33627688}
- target: {fileID: 2348914, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 1231479188}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1474170598 stripped
GameObject:
m_PrefabParentObject: {fileID: 159396, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_PrefabInternal: {fileID: 1474170597}
--- !u!1 &1474170599 stripped
GameObject:
m_PrefabParentObject: {fileID: 124034, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_PrefabInternal: {fileID: 1474170597}
--- !u!114 &1474170600
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1474170598}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b2f511c1adaa1e94ebe7ca97bbcabd17, type: 3}
m_Name:
m_EditorClassIdentifier:
pose: {fileID: 0}
interactWithUI: {fileID: 11400000, guid: 4a1ec738249f25e4f824949a16c0b085, type: 2}
active: 1
color: {r: 0, g: 0, b: 0, a: 0}
thickness: 0.002
clickColor: {r: 0, g: 1, b: 0, a: 1}
holder: {fileID: 0}
pointer: {fileID: 0}
addRigidBody: 0
reference: {fileID: 0}
--- !u!114 &1474170601
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1474170599}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b2f511c1adaa1e94ebe7ca97bbcabd17, type: 3}
m_Name:
m_EditorClassIdentifier:
pose: {fileID: 0}
interactWithUI: {fileID: 11400000, guid: 4a1ec738249f25e4f824949a16c0b085, type: 2}
active: 1
color: {r: 0, g: 0, b: 0, a: 0}
thickness: 0.002
clickColor: {r: 0, g: 1, b: 0, a: 1}
holder: {fileID: 0}
pointer: {fileID: 0}
addRigidBody: 0
reference: {fileID: 0}
--- !u!1 &1548954329
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1548954331}
- 108: {fileID: 1548954330}
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 &1548954330
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
m_Enabled: 1
serializedVersion: 7
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_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1548954331
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
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_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1 &1578927695
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1578927699}
- 33: {fileID: 1578927698}
- 23: {fileID: 1578927697}
- 65: {fileID: 1578927696}
m_Layer: 0
m_Name: Floor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &1578927696
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 10, y: 0.1, z: 10.000001}
m_Center: {x: 0, y: -0.05, z: 0}
--- !u!23 &1578927697
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: b41d1116a101a84499296ce28d16e6b9, type: 2}
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!33 &1578927698
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1578927699
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 4, y: 3, z: 4}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1

View File

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

View File

@ -0,0 +1,551 @@
%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, g: 0, b: 0, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 7
m_GIWorkflowMode: 1
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: 1
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: 256
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!1 &24851820
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 24851825}
- 33: {fileID: 24851824}
- 135: {fileID: 24851823}
- 23: {fileID: 24851822}
- 54: {fileID: 24851821}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!54 &24851821
Rigidbody:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 1
m_Constraints: 0
m_CollisionDetection: 0
--- !u!23 &24851822
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
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!135 &24851823
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Material: {fileID: 13400000, guid: 2e81b378186c0ed4c98c04cfd4096914, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &24851824
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &24851825
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 24851820}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1.624, z: 2.68}
m_LocalScale: {x: 0.5, y: 0.5, z: 0.5}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 3
--- !u!43 &333680539
Mesh:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name:
serializedVersion: 8
m_SubMeshes:
- serializedVersion: 2
firstByte: 0
indexCount: 24
topology: 0
firstVertex: 0
vertexCount: 8
localAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_Shapes:
vertices: []
shapes: []
channels: []
fullWeights: []
m_BindPose: []
m_BoneNameHashes:
m_RootBoneNameHash: 0
m_MeshCompression: 0
m_IsReadable: 1
m_KeepVertices: 1
m_KeepIndices: 1
m_IndexBuffer: 000004000100010004000500010005000200020005000600020006000300030006000700030007000000000007000400
m_Skin: []
m_VertexData:
m_CurrentChannels: 13
m_VertexCount: 8
m_Channels:
- stream: 0
offset: 0
format: 0
dimension: 3
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 12
format: 0
dimension: 4
- stream: 0
offset: 28
format: 0
dimension: 2
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
- stream: 0
offset: 0
format: 0
dimension: 0
m_DataSize: 288
_typelessdata: 0000c03f0ad7233c000090bf000000000000803f0000803f0000803f00000000000000000000c0bf0ad7233c000090bf000000000000803f0000803f0000803f0000803f000000000000c0bf0ad7233c0000903f000000000000803f0000803f0000803f00000000000000000000c03f0ad7233c0000903f000000000000803f0000803f0000803f0000803f000000003333d33f0ad7233c3333a3bf000000000000803f0000803f00000000000000000000803f3333d3bf0ad7233c3333a3bf000000000000803f0000803f000000000000803f0000803f3333d3bf0ad7233c3333a33f000000000000803f0000803f00000000000000000000803f3333d33f0ad7233c3333a33f000000000000803f0000803f000000000000803f0000803f
m_CompressedMesh:
m_Vertices:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_UV:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Normals:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Tangents:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_Weights:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_NormalSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_TangentSigns:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_FloatColors:
m_NumItems: 0
m_Range: 0
m_Start: 0
m_Data:
m_BitSize: 0
m_BoneIndices:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_Triangles:
m_NumItems: 0
m_Data:
m_BitSize: 0
m_UVInfo: 0
m_LocalAABB:
m_Center: {x: 0, y: 0.01, z: 0}
m_Extent: {x: 1.65, y: 0, z: 1.275}
m_MeshUsageFlags: 0
m_BakedConvexCollisionMesh:
m_BakedTriangleCollisionMesh:
m_MeshOptimized: 0
--- !u!1001 &1474170597
Prefab:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 420908, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 3380982, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Mesh
value:
objectReference: {fileID: 333680539}
- target: {fileID: 2348914, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
propertyPath: m_Materials.Array.data[0]
value:
objectReference: {fileID: 1639470597}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_IsPrefabParent: 0
--- !u!1 &1474170598 stripped
GameObject:
m_PrefabParentObject: {fileID: 146900, guid: 4d293c8e162f3874b982baadd71153d2, type: 2}
m_PrefabInternal: {fileID: 1474170597}
--- !u!114 &1474170599
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1474170598}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2578089a96464b348a5399c795afc7b7, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1548954329
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1548954331}
- 108: {fileID: 1548954330}
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 &1548954330
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
m_Enabled: 1
serializedVersion: 7
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_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1548954331
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1548954329}
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_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1 &1578927695
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 1578927699}
- 33: {fileID: 1578927698}
- 23: {fileID: 1578927697}
- 65: {fileID: 1578927696}
m_Layer: 0
m_Name: Floor
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!65 &1578927696
BoxCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 10, y: 0.1, z: 10.000001}
m_Center: {x: 0, y: -0.05, z: 0}
--- !u!23 &1578927697
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: b41d1116a101a84499296ce28d16e6b9, type: 2}
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!33 &1578927698
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1578927699
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1578927695}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 4, y: 3, z: 4}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
--- !u!21 &1639470597
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Sprites/Default
m_Shader: {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: PixelSnap
second: 0
m_Colors:
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 73743b10c3912094a8a17bc7ac370c15
timeCreated: 1550629235
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: 4b6669fb4e4df9c48926f02b694be9d1
timeCreated: 1437433018
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

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