kõik vanad helid lisatud, peaaegu kõik esimese iteratsiooni helid on lisatud, auto jaoks üks lisaloogika on tehtud
This commit is contained in:
@@ -2,12 +2,22 @@ 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 void Awake()
|
||||
{
|
||||
PortalEntrance = AudioManager.Instance.CreateInstance(FMODEvents.Instance.PortalEnter);
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
|
||||
XROrigin player = other.GetComponent<XROrigin>();
|
||||
if (player == null) return;
|
||||
|
||||
@@ -30,7 +40,12 @@ public class SpaceEnterCollider : MonoBehaviour
|
||||
{
|
||||
playerGravity.isInSpace = true;
|
||||
}
|
||||
|
||||
|
||||
Debug.Log(other + " entered space.");
|
||||
|
||||
PortalEntrance.start();
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerExit(Collider other)
|
||||
@@ -42,9 +57,13 @@ 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();
|
||||
|
||||
}
|
||||
|
||||
private IEnumerator DelayExit(GravityHandler playerGravity)
|
||||
|
||||
@@ -70,7 +70,6 @@ public class StencilPortal : MonoBehaviour
|
||||
matchOrientation = MatchOrientation.TargetUpAndForward
|
||||
};
|
||||
|
||||
AudioManager.Instance.PlayOneShot3D(FMODEvents.Instance.PortalEnter, targetPosition);
|
||||
|
||||
teleportationProvider.QueueTeleportRequest(request);
|
||||
|
||||
@@ -96,8 +95,6 @@ public class StencilPortal : MonoBehaviour
|
||||
if (!_shouldTeleport || IsInvoking(nameof(AllowTeleport))) return;
|
||||
if (!other.CompareTag("Player")) return;
|
||||
|
||||
AudioManager.Instance.PlayAttachedInstance(FMODEvents.Instance.PortalEnter, gameObject);
|
||||
|
||||
Debug.Log(transform.name + " player exited");
|
||||
Invoke(nameof(AllowTeleport), 1f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user