You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.EventSystems; |
|
using UnityEngine.UI; |
|
|
|
public class RoleItem : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler |
|
{ |
|
public UserData userData; |
|
|
|
private Transform KickOutImage; |
|
|
|
private Button KickOutButton; |
|
void Start() |
|
{ |
|
KickOutImage = transform.Find("KickOutImage"); |
|
KickOutButton = KickOutImage.transform.Find("KickOutButton").GetComponent<Button>(); |
|
} |
|
|
|
public void OnPointerEnter(PointerEventData eventData) |
|
{ |
|
if (CurrentUserInfo.room.Owner.UserInfo.Id == CurrentUserInfo.mySelf.Id) |
|
{ |
|
if (GetComponent<RoleItem>().userData.UserInfo.Id != CurrentUserInfo.room.Owner.UserInfo.Id) |
|
{ |
|
KickOutImage.gameObject.SetActive(true); |
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public void OnPointerExit(PointerEventData eventData) |
|
{ |
|
if (CurrentUserInfo.room.Owner.UserInfo.Id == CurrentUserInfo.mySelf.Id) |
|
{ |
|
KickOutImage.gameObject.SetActive(false); |
|
} |
|
} |
|
} |
|
|
|
|