UI components completed
added button functionality and mesh grid to scene
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class SampleButton : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
||||
{
|
||||
[SerializeField] private Image _img;
|
||||
[SerializeField] private Sprite _default, _pressed;
|
||||
|
||||
|
||||
public void OnPointerDown(PointerEventData eventData)
|
||||
{
|
||||
|
||||
_img.sprite = _pressed;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
|
||||
_img.sprite = _default;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void IWasClicked()
|
||||
{
|
||||
Debug.Log("Placing Mode: Sample");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user