2022-05-10 19:24:07 +08:00

44 lines
902 B
C#

using Assets.Scripts;
using UnityEngine;
using UnityEngine.UI;
public class GameRoomHead : MonoBehaviour
{
public Image IconOwnerLightImg;
public Image IconOwnerImg;
public RawImage Head;
private bool IsOwner { get; set; }
private float timer = 1f;
private void Update()
{
timer -= Time.deltaTime;
while (timer < 0)
{
timer += 1f;
}
}
public void Set(string headUrl,bool isOwner)
{
Utils.DisplayImage(Head, headUrl);
IsOwner = isOwner;
IconOwnerImg.gameObject.SetActive(isOwner);
}
public void ShowLight()
{
IconOwnerImg.gameObject.SetActive(false);
IconOwnerLightImg.gameObject.SetActive(IsOwner);
}
public void ShowShadow()
{
IconOwnerImg.gameObject.SetActive(IsOwner);
IconOwnerLightImg.gameObject.SetActive(false);
}
}