You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
841 B
35 lines
841 B
4 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class ForcibleEntryCheck : MonoBehaviour
|
||
|
{
|
||
|
public ForcibleEntryCtrl fec;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
fec = GetComponentInParent<ForcibleEntryCtrl>();
|
||
|
}
|
||
|
|
||
|
private void OnTriggerEnter(Collider other)
|
||
|
{
|
||
|
if (other.gameObject.GetComponent<Bags>())
|
||
|
{
|
||
|
if (!fec.FireManOnRightPos.Contains(other.gameObject))
|
||
|
{
|
||
|
fec.FireManOnRightPos.Add(other.gameObject);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
private void OnTriggerExit(Collider other)
|
||
|
{
|
||
|
if (other.gameObject.GetComponent<Bags>())
|
||
|
{
|
||
|
if (fec.FireManOnRightPos.Contains(other.gameObject))
|
||
|
{
|
||
|
fec.FireManOnRightPos.Remove(other.gameObject);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|