39 lines
822 B
C#
39 lines
822 B
C#
using UnityEngine;
|
|
using asap.core;
|
|
using Game;
|
|
|
|
|
|
public class PinballUncountableFxTrigger : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject _fx;
|
|
[SerializeField] private string audioUrl = "";
|
|
|
|
private void Awake()
|
|
{
|
|
if (_fx != null)
|
|
_fx.SetActive(false);
|
|
}
|
|
|
|
private void OnTriggerEnter2D(Collider2D collision)
|
|
{
|
|
if (!collision.CompareTag("PinballUncountable"))
|
|
return;
|
|
if (_fx != null)
|
|
{
|
|
_fx.SetActive(false);
|
|
_fx.SetActive(true);
|
|
}
|
|
if (audioUrl != "")
|
|
{
|
|
GContext.Publish(new EventRewardSound(audioUrl));
|
|
}
|
|
|
|
// Debug.Log("[PinballUncountable] Fx Trigger", this);
|
|
}
|
|
|
|
private void Reset()
|
|
{
|
|
_fx = transform.GetChild(0).gameObject;
|
|
}
|
|
}
|