using UnityEngine;
using UnityEngine.UI;
using System.Collections;
namespace WorldStreamer2
{
///
/// Player position U.
///
public class PlayerPositionUI : MonoBehaviour
{
[Tooltip("Object that should be moved during respawn/teleport process. It must be the same as object that streamer fallows during streaming process.")]
///
/// The player.
///
public Transform player;
[Tooltip("If you use Floating Point fix system drag and drop world mover prefab from your scene hierarchy.")]
///
/// The world mover.
///
public WorldMover worldMover;
///
/// The text.
///
public Text text;
public void Start()
{
if (player == null)
Debug.LogError("Player is not connected to Position Gizmo");
text.text = "Player position: Player is not connected to Position Gizmo";
}
///
/// Update this instance and shows player real position and player position after move.
///
public void Update()
{
if (player != null)
if (worldMover != null)
text.text = "Player position: " + player.transform.position + "\nPlayer real position: " + worldMover.playerPositionMovedLooped;
else
text.text = "Player position: " + player.transform.position + "\nPlayer real position: Not Connected to World Mover";
}
}
}