28 lines
730 B
C#
28 lines
730 B
C#
using Fruitomation.Game.Items;
|
|
using UnityEngine;
|
|
|
|
namespace Fruitomation.Game
|
|
{
|
|
public class MixerBuilding : Building
|
|
{
|
|
[Header("Mixer Specific")]
|
|
[SerializeField] private RectTransform OutputLocation;
|
|
[SerializeField] private TriggerDetector Trigger;
|
|
|
|
private void Start()
|
|
{
|
|
Trigger.SetAction(other =>
|
|
{
|
|
bool isItem = other.transform.parent.TryGetComponent(out ItemBehaviour item);
|
|
if (!isItem)
|
|
{
|
|
return;
|
|
}
|
|
|
|
item.transform.position = OutputLocation.position;
|
|
|
|
}, TriggerType.Enter);
|
|
}
|
|
}
|
|
}
|