XR Origin init
This commit is contained in:
parent
f0ce3b5ddb
commit
d1e8501de2
1813
escaperoom/Assets/Scenes/XROrigin_Scene.unity
Normal file
1813
escaperoom/Assets/Scenes/XROrigin_Scene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
escaperoom/Assets/Scenes/XROrigin_Scene.unity.meta
Normal file
7
escaperoom/Assets/Scenes/XROrigin_Scene.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ef3736a543871344c86b56d2def82c0e
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
8
escaperoom/Assets/Scripts.meta
Normal file
8
escaperoom/Assets/Scripts.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: d1a76dfb78bb1584d92a472008cd49de
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
33
escaperoom/Assets/Scripts/ContinousMovement.cs
Normal file
33
escaperoom/Assets/Scripts/ContinousMovement.cs
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using Unity.XR.CoreUtils;
|
||||||
|
|
||||||
|
public class ContinousMovement : MonoBehaviour
|
||||||
|
{
|
||||||
|
private CharacterController character;
|
||||||
|
private XROrigin rig;
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
character = GetComponent<CharacterController>();
|
||||||
|
rig = GetComponent<XROrigin>();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FixedUpdate()
|
||||||
|
{
|
||||||
|
CapsuleFollorHeadset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CapsuleFollorHeadset()
|
||||||
|
{
|
||||||
|
character.height = rig.CameraInOriginSpaceHeight;
|
||||||
|
Vector3 capsuleCenter = transform.InverseTransformPoint(rig.Camera.transform.position);
|
||||||
|
character.center = new Vector3(capsuleCenter.x, character.height / 2 + character.skinWidth, capsuleCenter.z);
|
||||||
|
}
|
||||||
|
}
|
11
escaperoom/Assets/Scripts/ContinousMovement.cs.meta
Normal file
11
escaperoom/Assets/Scripts/ContinousMovement.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 0821b93a8dd8de1449d7b1252c0e8ecb
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -4,4 +4,39 @@
|
|||||||
PresetManager:
|
PresetManager:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_DefaultPresets: {}
|
m_DefaultPresets:
|
||||||
|
- first:
|
||||||
|
m_NativeTypeID: 114
|
||||||
|
m_ManagedTypePPtr: {fileID: 11500000, guid: 2213c36610e3b1c4bbf886810ed9db12, type: 3}
|
||||||
|
m_ManagedTypeFallback:
|
||||||
|
second:
|
||||||
|
- m_Preset: {fileID: 2655988077585873504, guid: 18697d253d848974aa7052cba872c9f0, type: 2}
|
||||||
|
m_Filter:
|
||||||
|
m_Disabled: 0
|
||||||
|
- first:
|
||||||
|
m_NativeTypeID: 114
|
||||||
|
m_ManagedTypePPtr: {fileID: 11500000, guid: caff514de9b15ad48ab85dcff5508221, type: 3}
|
||||||
|
m_ManagedTypeFallback:
|
||||||
|
second:
|
||||||
|
- m_Preset: {fileID: 2655988077585873504, guid: 1421ad86ff3787b4dae70fe9e699a25f, type: 2}
|
||||||
|
m_Filter:
|
||||||
|
m_Disabled: 0
|
||||||
|
- m_Preset: {fileID: 2655988077585873504, guid: ffd8268f7307a0c48a067dad4a8fe060, type: 2}
|
||||||
|
m_Filter:
|
||||||
|
m_Disabled: 0
|
||||||
|
- first:
|
||||||
|
m_NativeTypeID: 114
|
||||||
|
m_ManagedTypePPtr: {fileID: 11500000, guid: 0bf296fc962d7184ab14ad1841598d5f, type: 3}
|
||||||
|
m_ManagedTypeFallback:
|
||||||
|
second:
|
||||||
|
- m_Preset: {fileID: 2655988077585873504, guid: 91f9da00cfdac5d49955df2d2d820b9c, type: 2}
|
||||||
|
m_Filter:
|
||||||
|
m_Disabled: 0
|
||||||
|
- first:
|
||||||
|
m_NativeTypeID: 114
|
||||||
|
m_ManagedTypePPtr: {fileID: 11500000, guid: 919e39492806b334982b6b84c90dd927, type: 3}
|
||||||
|
m_ManagedTypeFallback:
|
||||||
|
second:
|
||||||
|
- m_Preset: {fileID: 2655988077585873504, guid: 0caad3af14f9a414dbdf25ed41e5aa47, type: 2}
|
||||||
|
m_Filter:
|
||||||
|
m_Disabled: 0
|
||||||
|
Loading…
Reference in New Issue
Block a user