32 lines
564 B
C#
32 lines
564 B
C#
using UnityEngine;
|
|
using OHM.UnityToolkit;
|
|
using UnityEngine.Serialization;
|
|
|
|
public class ThresholdRichZone : MonoBehaviour
|
|
{
|
|
public int thresholdToPass;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("fxPass")]
|
|
private FX _fxPass;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("fxLoose")]
|
|
private FX _fxLoose;
|
|
|
|
[SerializeField]
|
|
private Transform spawnFx;
|
|
|
|
public bool isUse { get; private set; }
|
|
|
|
public void TryTakeThePass(bool canPass)
|
|
{
|
|
isUse = true;
|
|
FX fx = (canPass ? _fxPass : _fxLoose);
|
|
if (fx != null)
|
|
{
|
|
fx.PlayInstance(spawnFx, null);
|
|
}
|
|
}
|
|
}
|