Merging retry

This commit is contained in:
DerTyp187
2021-12-16 22:08:59 +01:00
parent 151f63c9fb
commit 0beeed4540
53 changed files with 8373 additions and 6 deletions

View File

@@ -0,0 +1,39 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class MenuBtn : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
[Header("Background Image")]
[SerializeField] private GameObject BtnBgImage;
[SerializeField] private Color BgColor;
[SerializeField] private Color OnHoverBgColor;
private bool mouse_over = false;
public void Update()
{
if (mouse_over)
{
BtnBgImage.GetComponent<Image>().color = OnHoverBgColor;
}
else
{
BtnBgImage.GetComponent<Image>().color = BgColor;
}
}
public void OnPointerEnter(PointerEventData e)
{
mouse_over = true;
}
public void OnPointerExit(PointerEventData e)
{
mouse_over = false;
}
}