add ready player me POC

This commit is contained in:
2024-11-22 07:08:52 +02:00
parent 855639487b
commit 7c4e48f388
1033 changed files with 224048 additions and 28 deletions
@@ -0,0 +1,52 @@
using UnityEngine;
using UnityEngine.UI;
namespace ReadyPlayerMe.Core.WebView
{
/// <summary>
/// This class is responsible for displaying and updating a UI panel and message text.
/// </summary>
public class MessagePanel : MonoBehaviour
{
[SerializeField] private Text messageLabel;
/// <summary>
/// Set message from a string value.
/// </summary>
/// <param name="message">Message to display.</param>
public void SetMessage(string message)
{
messageLabel.text = message;
}
/// <summary>
/// Set message from a message type.
/// </summary>
/// <param name="type">Describes the option for the message that is to be displayed.</param>
public void SetMessage(MessageType type)
{
messageLabel.text = type.GetValue();
}
/// <summary>
/// Set message panel visibility.
/// </summary>
public void SetVisible(bool visible)
{
gameObject.SetActive(visible);
}
/// <summary>
/// Set message panel padding in pixels.
/// </summary>
public void SetMargins(int left, int top, int right, int bottom)
{
var rect = transform as RectTransform;
if (rect != null)
{
rect.offsetMax = new Vector2(-right, -top);
rect.offsetMin = new Vector2(left, bottom);
}
}
}
}