Merge branch 'main' into dev/desert-heavy
This commit is contained in:
commit
67cd2dd7c0
@ -40,17 +40,6 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler, IPoin
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
if (!_outline && _unitGameObject.TryGetComponent(out House currentBuilding))
|
||||
{
|
||||
_outline = new GameObject("Outline");
|
||||
|
||||
var rend = _outline.AddComponent<SpriteRenderer>();
|
||||
rend.sprite = _rangeSprite;
|
||||
rend.sortingLayerName = "Character";
|
||||
rend.sortingOrder = 1;
|
||||
rend.color = new Color(1, 1, 1, 0.2f);
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
@ -106,6 +95,17 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler, IPoin
|
||||
_unitGameObject = parentGameObject;
|
||||
_canvas = canvas;
|
||||
_unitArt.sprite = unitUpgrade.UpgradeCardArt;
|
||||
|
||||
if (_outline == null && _unitGameObject.TryGetComponent(out House currentBuilding))
|
||||
{
|
||||
_outline = new GameObject("Outline");
|
||||
|
||||
var rend = _outline.AddComponent<SpriteRenderer>();
|
||||
rend.sprite = _rangeSprite;
|
||||
rend.sortingLayerName = "Character";
|
||||
rend.sortingOrder = 1;
|
||||
rend.color = new Color(1, 1, 1, 0.2f);
|
||||
}
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
@ -133,8 +133,12 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler, IPoin
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
HideTooltip();
|
||||
|
||||
if (_outline)
|
||||
{
|
||||
_outline.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void HideTooltip()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user