17 lines
524 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeleteShovel : DraggablePlaceholder
{
public override void Place()
{
var hit = LevelManager.Instance.Get<Ally>(x => x.Position.IsContainedIn(transform.position));
if (hit) Destroy(hit.gameObject);
}
public override bool CanBePlacedHere()
{
return LevelBoundCache.Contains(transform.position) && LevelManager.Instance.Has<Ally>(x => x.Position.IsContainedIn(transform.position));
}
}