28 lines
807 B
C#
28 lines
807 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SacrificeArea : MonoBehaviour
|
|
{
|
|
public Sacrifice_Buildings sacrifice_Buildings;
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
Debug.Log(other.transform.name);
|
|
if (other.transform.name.Contains("Blob"))
|
|
{
|
|
if (other.gameObject.GetComponent<BlobController>().isDragging)
|
|
{
|
|
sacrifice_Buildings.BlobDragging = other.gameObject.GetComponent<BlobController>();
|
|
}
|
|
}
|
|
}
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
|
|
if (sacrifice_Buildings.BlobDragging != null && other.transform == sacrifice_Buildings.BlobDragging.transform)
|
|
{
|
|
sacrifice_Buildings.BlobDragging = null;
|
|
}
|
|
}
|
|
}
|