fixed button transparency
This commit is contained in:
parent
f88d4e5998
commit
118230c128
5 changed files with 47 additions and 0 deletions
35
Project Undercover/Assets/Scripts/UI/CanvasClickCheck.cs
Normal file
35
Project Undercover/Assets/Scripts/UI/CanvasClickCheck.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.EventSystems; //required for Event data
|
||||
|
||||
public class CanvasClickCheck : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
GameObject currentHover;
|
||||
static CanvasClickCheck Singleton;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (Singleton != null)
|
||||
Debug.LogError("Should only be one Canvas Click Check");
|
||||
Singleton = this;
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
if (eventData.pointerCurrentRaycast.gameObject != null)
|
||||
{
|
||||
Debug.Log("Mouse Over: " + eventData.pointerCurrentRaycast.gameObject.name);
|
||||
currentHover = eventData.pointerCurrentRaycast.gameObject;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
currentHover = null;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (currentHover)
|
||||
Debug.Log(currentHover.name + " @ " + Input.mousePosition);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a90dbf15f0bd8e241ba5457337c0ac08
|
||||
timeCreated: 1512070217
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
Before Width: | Height: | Size: 899 KiB After Width: | Height: | Size: 61 KiB |
Binary file not shown.
Before Width: | Height: | Size: 900 KiB After Width: | Height: | Size: 60 KiB |
Binary file not shown.
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 117 KiB |
Reference in a new issue