projectEli/Assets/NeoFPS/Samples/SinglePlayer/Scenes/FeatureDemos/JetpacksAndGuidedMissiles/JetpacksMissilesOutOfBoundsHUD.cs
2022-11-06 20:28:33 -05:00

28 lines
713 B
C#

using NeoFPS.ModularFirearms;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NeoFPS.SinglePlayer;
using UnityEngine.Events;
namespace NeoFPS.Samples.SinglePlayer
{
public class JetpacksMissilesOutOfBoundsHUD : MonoBehaviour
{
private void Awake()
{
JetpacksMissilesOutOfBounds.onIsOutOfBoundsChanged += OnIsOutOfBoundsChanged;
gameObject.SetActive(false);
}
private void OnDestroy()
{
JetpacksMissilesOutOfBounds.onIsOutOfBoundsChanged -= OnIsOutOfBoundsChanged;
}
void OnIsOutOfBoundsChanged(bool oob)
{
gameObject.SetActive(oob);
}
}
}