34 lines
816 B
C#
34 lines
816 B
C#
using UnityEngine;
|
|
/// <summary>
|
|
/// 拿取地线
|
|
/// </summary>
|
|
public class TakeOutLine : MonoBehaviour
|
|
{
|
|
public OneValueSyncObject isTake;
|
|
|
|
public void OnTriggerExit(Collider other)
|
|
{
|
|
if (other.name.Equals("GroundLine"))
|
|
{
|
|
isTake.mybool = true;
|
|
isTake.SendSync();
|
|
if (isTake.action_apprisedetail != null)
|
|
{
|
|
isTake.action_apprisedetail.Invoke();
|
|
}
|
|
}
|
|
}
|
|
public void OnTriggerStay(Collider other)
|
|
{
|
|
if (other.name.Equals("GroundLine") && isTake.mybool)
|
|
{
|
|
isTake.mybool = false;
|
|
isTake.SendSync();
|
|
if (isTake.action_apprisedetail != null)
|
|
{
|
|
isTake.action_apprisedetail.Invoke();
|
|
}
|
|
}
|
|
}
|
|
}
|