made skywalk teleportation istructions flip according to the rotation of the entered player.
This commit is contained in:
parent
eadbd139e4
commit
a8568685ab
@ -323,12 +323,12 @@ public class Menu : MonoBehaviour
|
|||||||
if (PlayericonFloor1Parent.activeSelf)
|
if (PlayericonFloor1Parent.activeSelf)
|
||||||
{
|
{
|
||||||
PlayericonFloor1.GetComponent<RectTransform>().anchoredPosition = IMG_Player;
|
PlayericonFloor1.GetComponent<RectTransform>().anchoredPosition = IMG_Player;
|
||||||
Debug.Log(IMG_Player);
|
//Debug.Log(IMG_Player);
|
||||||
}
|
}
|
||||||
if (PlayericonFloor2Parent.activeSelf)
|
if (PlayericonFloor2Parent.activeSelf)
|
||||||
{
|
{
|
||||||
PlayericonFloor2.GetComponent<RectTransform>().anchoredPosition = IMG_Player;
|
PlayericonFloor2.GetComponent<RectTransform>().anchoredPosition = IMG_Player;
|
||||||
Debug.Log(IMG_Player);
|
//Debug.Log(IMG_Player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,11 +1,30 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Unity.XR.CoreUtils;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class SpaceEnterCollider : MonoBehaviour
|
public class SpaceEnterCollider : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public GameObject InstructionText;
|
||||||
private void OnTriggerEnter(Collider other)
|
private void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
|
XROrigin player = other.GetComponent<XROrigin>();
|
||||||
|
if (player == null) return;
|
||||||
|
|
||||||
|
// Get player's Z rotation (in degrees)
|
||||||
|
float playerZ = player.transform.rotation.eulerAngles.z;
|
||||||
|
|
||||||
|
if (Mathf.Approximately(playerZ, 0f))
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
//Debug.Log("Instruction text rotation" + InstructionText.transform.rotation);
|
||||||
|
}
|
||||||
|
|
||||||
GravityHandler playerGravity = other.GetComponent<GravityHandler>();
|
GravityHandler playerGravity = other.GetComponent<GravityHandler>();
|
||||||
if (playerGravity != null)
|
if (playerGravity != null)
|
||||||
{
|
{
|
||||||
@ -16,6 +35,9 @@ public class SpaceEnterCollider : MonoBehaviour
|
|||||||
|
|
||||||
private void OnTriggerExit(Collider other)
|
private void OnTriggerExit(Collider other)
|
||||||
{
|
{
|
||||||
|
XROrigin Player = other.GetComponent<XROrigin>();
|
||||||
|
if (Player == null) return;
|
||||||
|
|
||||||
GravityHandler playerGravity = other.GetComponent<GravityHandler>();
|
GravityHandler playerGravity = other.GetComponent<GravityHandler>();
|
||||||
if (playerGravity != null)
|
if (playerGravity != null)
|
||||||
{
|
{
|
||||||
|
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
BIN
Assets/_PROJECT/Scenes/DeltaBuilding_base.unity
(Stored with Git LFS)
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user