projectEli/Assets/NeoFPS/Samples/SinglePlayer/Scenes/FeatureDemos/JetpacksAndGuidedMissiles/JetpacksMissilesOutOfBoundsHUD.cs

28 lines
713 B
C#
Raw Normal View History

2022-11-07 01:28:33 +00:00
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);
}
}
}