forked from cgvr/DeltaVR
Merge branch 'SamWorkset'
This commit is contained in:
@@ -123,7 +123,6 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6021721823031538141}
|
||||
- component: {fileID: 4707456952479937532}
|
||||
m_Layer: 0
|
||||
m_Name: Portal
|
||||
m_TagString: Untagged
|
||||
@@ -148,149 +147,8 @@ Transform:
|
||||
- {fileID: 1266057804064659733}
|
||||
- {fileID: 5614923999591170275}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_RootOrder: -1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!82 &4707456952479937532
|
||||
AudioSource:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4777591596180506993}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 4d691c6581003c94bbfe74b21deb8784, type: 3}
|
||||
m_PlayOnAwake: 1
|
||||
m_Volume: 0.8
|
||||
m_Pitch: 1
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
Priority: 128
|
||||
DopplerLevel: 1
|
||||
MinDistance: 1
|
||||
MaxDistance: 40
|
||||
Pan2D: 0
|
||||
rolloffMode: 2
|
||||
BypassEffects: 0
|
||||
BypassListenerEffects: 0
|
||||
BypassReverbZones: 0
|
||||
rolloffCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1.0028496
|
||||
inSlope: -40.015934
|
||||
outSlope: -40.015934
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.03449707
|
||||
value: 0.49145508
|
||||
inSlope: -10.0039835
|
||||
outSlope: -10.0039835
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.1
|
||||
value: 0.25
|
||||
inSlope: -2.5009959
|
||||
outSlope: -2.5009959
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.2
|
||||
value: 0.125
|
||||
inSlope: -0.62524897
|
||||
outSlope: -0.62524897
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.4348816
|
||||
value: 0.03970337
|
||||
inSlope: -0.15631224
|
||||
outSlope: -0.15631224
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.8
|
||||
value: 0
|
||||
inSlope: -0.03907806
|
||||
outSlope: -0.03907806
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
- serializedVersion: 3
|
||||
time: 0.9980469
|
||||
value: 0
|
||||
inSlope: -0.02500997
|
||||
outSlope: -0.02500997
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0
|
||||
outWeight: 0
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
panLevelCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
spreadCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 0
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
reverbZoneMixCustomCurve:
|
||||
serializedVersion: 2
|
||||
m_Curve:
|
||||
- serializedVersion: 3
|
||||
time: 0
|
||||
value: 1
|
||||
inSlope: 0
|
||||
outSlope: 0
|
||||
tangentMode: 0
|
||||
weightedMode: 0
|
||||
inWeight: 0.33333334
|
||||
outWeight: 0.33333334
|
||||
m_PreInfinity: 2
|
||||
m_PostInfinity: 2
|
||||
m_RotationOrder: 4
|
||||
--- !u!1 &6014189720456933605
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -409,6 +267,8 @@ GameObject:
|
||||
- component: {fileID: 2501038558182094805}
|
||||
- component: {fileID: 8089229340536715967}
|
||||
- component: {fileID: 7305371174892849299}
|
||||
- component: {fileID: 3068203956378754948}
|
||||
- component: {fileID: 4895790527008502425}
|
||||
m_Layer: 0
|
||||
m_Name: Portal
|
||||
m_TagString: Untagged
|
||||
@@ -527,3 +387,55 @@ MonoBehaviour:
|
||||
portalScene: {fileID: 7751003758844882782}
|
||||
occlusionPortal: {fileID: 0}
|
||||
_shouldTeleport: 1
|
||||
teleportationProvider: {fileID: 0}
|
||||
--- !u!54 &3068203956378754948
|
||||
Rigidbody:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8507770192447112443}
|
||||
serializedVersion: 4
|
||||
m_Mass: 0.001
|
||||
m_Drag: 0
|
||||
m_AngularDrag: 0
|
||||
m_CenterOfMass: {x: 0, y: 0, z: 0}
|
||||
m_InertiaTensor: {x: 1, y: 1, z: 1}
|
||||
m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ImplicitCom: 0
|
||||
m_ImplicitTensor: 0
|
||||
m_UseGravity: 0
|
||||
m_IsKinematic: 1
|
||||
m_Interpolate: 0
|
||||
m_Constraints: 0
|
||||
m_CollisionDetection: 0
|
||||
--- !u!114 &4895790527008502425
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8507770192447112443}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 6c6205a218222364ca440c740b7a6b8f, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
SelectAudio:
|
||||
Guid:
|
||||
Data1: 214152321
|
||||
Data2: 1136432684
|
||||
Data3: -1979358295
|
||||
Data4: 727957873
|
||||
Path: event:/Ambiences/PortalSpacial
|
||||
SoundOcclusionWidening: 1
|
||||
PlayerOcclusionWidening: 1
|
||||
OcclusionLayer:
|
||||
serializedVersion: 2
|
||||
m_Bits: 268438528
|
||||
|
||||
@@ -2,12 +2,27 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using FMOD.Studio;
|
||||
|
||||
public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
public GameObject InstructionText;
|
||||
|
||||
private EventInstance PortalEntrance;
|
||||
private EventInstance SpaceMusic;
|
||||
|
||||
private bool musicStarted = false;
|
||||
private void Awake()
|
||||
{
|
||||
PortalEntrance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.PortalEnter);
|
||||
|
||||
SpaceMusic = AudioManager.Instance.CreateInstance(FMODEvents.Instance.Kosmos);
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
|
||||
XROrigin player = other.GetComponent<XROrigin>();
|
||||
if (player == null) return;
|
||||
|
||||
@@ -18,7 +33,7 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
InstructionText.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
|
||||
//Debug.Log("Instruction text rotation" + InstructionText.transform.rotation);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
InstructionText.transform.rotation = Quaternion.Euler(0f, 0f, -180f);
|
||||
@@ -30,7 +45,21 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
playerGravity.isInSpace = true;
|
||||
}
|
||||
|
||||
|
||||
Debug.Log(other + " entered space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
|
||||
if (!musicStarted)
|
||||
{
|
||||
SpaceMusic.start();
|
||||
musicStarted = true;
|
||||
}
|
||||
|
||||
// Fade music in on entering
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 0f);
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -42,9 +71,14 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
if (playerGravity != null)
|
||||
{
|
||||
StartCoroutine(DelayExit(playerGravity));
|
||||
|
||||
//playerGravity.AdjustGravity(new Quaternion()); // Set Gravity back to default
|
||||
}
|
||||
Debug.Log(other + " left space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
// Fade music out on leaving
|
||||
SpaceMusic.setParameterByName("KosmosMusicVolume", 1.0f);
|
||||
}
|
||||
|
||||
private IEnumerator DelayExit(GravityHandler playerGravity)
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using UnityEngine.XR;
|
||||
using UnityEngine.XR.Interaction.Toolkit;
|
||||
|
||||
@@ -34,7 +35,11 @@ public class StencilPortal : MonoBehaviour
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
if (other.GetComponent<XROrigin>() == null) return;
|
||||
//Debug.Log("Something entered portal");
|
||||
if (other.GetComponent<UniversalAdditionalCameraData>() == null) return;
|
||||
//if (other.GetComponent<XROrigin>() == null) return;
|
||||
XROrigin player = other.GetComponentInParent<XROrigin>();
|
||||
if (player == null) return;
|
||||
|
||||
if (occlusionPortal != null)
|
||||
{
|
||||
@@ -55,8 +60,8 @@ public class StencilPortal : MonoBehaviour
|
||||
|
||||
if (teleportationProvider != null)
|
||||
{
|
||||
Vector3 targetPosition = TransformPositionBetweenPortals(this, targetPortal, other.transform.position);
|
||||
Quaternion targetRotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
Vector3 targetPosition = TransformPositionBetweenPortals(this, targetPortal, player.transform.position);
|
||||
Quaternion targetRotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
|
||||
TeleportRequest request = new TeleportRequest
|
||||
{
|
||||
@@ -65,20 +70,23 @@ public class StencilPortal : MonoBehaviour
|
||||
matchOrientation = MatchOrientation.TargetUpAndForward
|
||||
};
|
||||
|
||||
|
||||
teleportationProvider.QueueTeleportRequest(request);
|
||||
other.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
|
||||
player.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("TeleportationProvider is not assigned!", this);
|
||||
other.transform.position = TransformPositionBetweenPortals(this, targetPortal, other.transform.position);
|
||||
other.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, other.transform.rotation);
|
||||
player.transform.position = TransformPositionBetweenPortals(this, targetPortal, player.transform.position);
|
||||
player.transform.rotation = TransformRotationBetweenPortals(this, targetPortal, player.transform.rotation);
|
||||
}
|
||||
|
||||
if (destroyAfterTeleport)
|
||||
{
|
||||
Destroy(gameObject, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -86,6 +94,7 @@ public class StencilPortal : MonoBehaviour
|
||||
AllowTeleport();
|
||||
if (!_shouldTeleport || IsInvoking(nameof(AllowTeleport))) return;
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
Debug.Log(transform.name + " player exited");
|
||||
Invoke(nameof(AllowTeleport), 1f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user