trash tool
This commit is contained in:
Executable
+58
@@ -0,0 +1,58 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VectorGraphics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace UntitledLogicGame.UI
|
||||
{
|
||||
public class UIDelete : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
|
||||
{
|
||||
#region Unity Properties
|
||||
|
||||
public SVGImage openImage;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Properties
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SVGImage _image;
|
||||
private Sprite _closedSprite;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Unity Methods
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_image = GetComponent<SVGImage>();
|
||||
_closedSprite = _image.sprite;
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
_image.sprite = openImage.sprite;
|
||||
PointerManager.Instance.DeleteOnRelease = true;
|
||||
}
|
||||
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
_image.sprite = _closedSprite;
|
||||
PointerManager.Instance.DeleteOnRelease = false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07b6ed78fbbf4124794530c3e8451329
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -11,6 +11,7 @@ namespace UntitledLogicGame.UI
|
||||
|
||||
[Header("Components")]
|
||||
public GameObject GateBar;
|
||||
public GameObject MovingBar;
|
||||
|
||||
[Header("Prefabs")]
|
||||
public UIGate UIGatePrefab;
|
||||
@@ -41,16 +42,18 @@ namespace UntitledLogicGame.UI
|
||||
uiGate.RectTransform.anchoredPosition = new Vector2(currentPos, 0);
|
||||
currentPos += uiGate.RectTransform.sizeDelta.x;
|
||||
}
|
||||
|
||||
|
||||
MovingBar.SetActive(false);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if(MouseManager.Instance.Interacting != _lastMouseInteracting)
|
||||
if(PointerManager.Instance.Interacting != _lastMouseInteracting)
|
||||
{
|
||||
//TODO animate go down
|
||||
GateBar.SetActive(!MouseManager.Instance.Interacting);
|
||||
_lastMouseInteracting = MouseManager.Instance.Interacting;
|
||||
GateBar.SetActive(!PointerManager.Instance.Interacting);
|
||||
MovingBar.SetActive(PointerManager.Instance.MovingObject);
|
||||
_lastMouseInteracting = PointerManager.Instance.Interacting;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user