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);
|
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()
|
void Update()
|
||||||
@ -106,6 +95,17 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler, IPoin
|
|||||||
_unitGameObject = parentGameObject;
|
_unitGameObject = parentGameObject;
|
||||||
_canvas = canvas;
|
_canvas = canvas;
|
||||||
_unitArt.sprite = unitUpgrade.UpgradeCardArt;
|
_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)
|
public void OnPointerEnter(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
@ -133,7 +133,11 @@ public class UpgradePlacementButton : MonoBehaviour, IPointerClickHandler, IPoin
|
|||||||
public void OnPointerExit(PointerEventData eventData)
|
public void OnPointerExit(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
HideTooltip();
|
HideTooltip();
|
||||||
_outline.SetActive(false);
|
|
||||||
|
if (_outline)
|
||||||
|
{
|
||||||
|
_outline.SetActive(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideTooltip()
|
private void HideTooltip()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user