glass layer occlusion, previous event occlusion changes, locomotaion steps change, ui hovers (for some reason currently play when a new location is set)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -9,7 +10,7 @@ public enum ElevatorMoveState
|
||||
Decending
|
||||
}
|
||||
|
||||
public class ElevatorStatusPlate : MonoBehaviour
|
||||
public class ElevatorStatusPlate : NetworkBehaviour
|
||||
{
|
||||
[System.Serializable]
|
||||
public struct FloorNumbers
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using _PROJECT.NewHandPresence;
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
@@ -14,7 +15,7 @@ public enum ElevatorState
|
||||
}
|
||||
|
||||
|
||||
public class ElevatorBox : MonoBehaviour
|
||||
public class ElevatorBox : NetworkBehaviour
|
||||
{
|
||||
public List<ElevatorOuter> callers = new List<ElevatorOuter>();
|
||||
|
||||
@@ -129,8 +130,10 @@ public class ElevatorBox : MonoBehaviour
|
||||
}
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
|
||||
XROrigin enteredPlayerVR = other.GetComponent<XROrigin>();
|
||||
KbmController enteredPlayerKbm = other.GetComponent<KbmController>();
|
||||
XRPlayerMirror networkPlayerDisplay = other.GetComponentInParent<XRPlayerMirror>();
|
||||
|
||||
Debug.Log("Player Entered box");
|
||||
if (enteredPlayerVR != null)
|
||||
@@ -141,11 +144,19 @@ public class ElevatorBox : MonoBehaviour
|
||||
{
|
||||
enteredPlayerKbm.transform.SetParent(this.transform);
|
||||
}
|
||||
else
|
||||
else if (networkPlayerDisplay != null)
|
||||
{
|
||||
//don't do any parenting but don't halt the function
|
||||
}
|
||||
else {
|
||||
|
||||
Debug.Log(other + " Cannot ride in lifts.");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log("Calling Lift transfer sequence");
|
||||
|
||||
switch (targetFloor)
|
||||
switch (targetFloor)
|
||||
{
|
||||
case int f when f == floors[0].floorNumber:
|
||||
targetFloor = floors[1].floorNumber;
|
||||
@@ -158,7 +169,7 @@ public class ElevatorBox : MonoBehaviour
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
StartCoroutine(LiftTransferSequence());
|
||||
}
|
||||
|
||||
@@ -169,6 +180,8 @@ public class ElevatorBox : MonoBehaviour
|
||||
// Was it a player, that exited?
|
||||
XROrigin exitedPlayerVR = other.GetComponent<XROrigin>();
|
||||
KbmController exitedPlayerKbm = other.GetComponent<KbmController>();
|
||||
XRPlayerMirror networkPlayerDisplay = other.GetComponentInParent<XRPlayerMirror>();
|
||||
|
||||
if (exitedPlayerVR != null)
|
||||
{
|
||||
removeChild(exitedPlayerVR);
|
||||
@@ -177,6 +190,10 @@ public class ElevatorBox : MonoBehaviour
|
||||
{
|
||||
exitedPlayerKbm.transform.SetParent(null);
|
||||
}
|
||||
else if (networkPlayerDisplay != null)
|
||||
{
|
||||
//don't do any parenting but don't halt the function
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
@@ -263,6 +280,7 @@ public class ElevatorBox : MonoBehaviour
|
||||
|
||||
private IEnumerator LiftTransferSequence()
|
||||
{
|
||||
Debug.Log("Started Lidt transfer sequence");
|
||||
yield return StartCoroutine(CloseDoors());
|
||||
yield return StartCoroutine(MoveToFloor(targetFloor));
|
||||
}
|
||||
@@ -295,7 +313,7 @@ public class ElevatorBox : MonoBehaviour
|
||||
private IEnumerator CloseDoors()
|
||||
{
|
||||
//if (state == ElevatorState.AwaitingPassengers) {
|
||||
//Debug.Log("Closing doors");
|
||||
Debug.Log("Closing doors");
|
||||
|
||||
if (Vector3.Distance(leftDoor.transform.position, leftDoorClosedPos.position) < 0.01f)
|
||||
yield break;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using FishNet.Object;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.XR.CoreUtils;
|
||||
using UnityEngine;
|
||||
|
||||
public class ElevatorOuter : MonoBehaviour
|
||||
public class ElevatorOuter : NetworkBehaviour
|
||||
{
|
||||
public ElevatorBox box;
|
||||
|
||||
@@ -32,7 +33,7 @@ public class ElevatorOuter : MonoBehaviour
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
Debug.Log("Something entered call area");
|
||||
if (other.GetComponent<XROrigin>() == null && other.GetComponent<KbmController>() == null) return;
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
StartCoroutine(box.callElevator(floor));
|
||||
Debug.Log("Player entered call area");
|
||||
}
|
||||
@@ -40,7 +41,7 @@ public class ElevatorOuter : MonoBehaviour
|
||||
private void OnTriggerExit(Collider other)
|
||||
{
|
||||
Debug.Log("Something entered call area");
|
||||
if (other.GetComponent<XROrigin>() == null && other.GetComponent<KbmController>() == null) return;
|
||||
if (other.GetComponentInParent<XRPlayerMirror>() == null) return;
|
||||
box.interestExpired();
|
||||
Debug.Log("Player exited call area");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user