mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 09:35:26 +00:00
42 lines
1003 B
C#
42 lines
1003 B
C#
using QSB.Utility;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.ProbeSync
|
|
{
|
|
public class QSBProbe : MonoBehaviour
|
|
{
|
|
public delegate void SurveyorProbeEvent();
|
|
public delegate void RetrieveEvent(float retrieveLength);
|
|
|
|
public event SurveyorProbeEvent OnLaunchProbe;
|
|
public event SurveyorProbeEvent OnAnchorProbe;
|
|
public event SurveyorProbeEvent OnUnanchorProbe;
|
|
public event SurveyorProbeEvent OnRetrieveProbe;
|
|
public event SurveyorProbeEvent OnProbeDestroyed;
|
|
public event RetrieveEvent OnStartRetrieveProbe;
|
|
|
|
private GameObject _detectorObj;
|
|
private RulesetDetector _rulesetDetector;
|
|
|
|
public RulesetDetector GetRulesetDetector()
|
|
=> _rulesetDetector;
|
|
|
|
private void Awake()
|
|
{
|
|
_detectorObj = GetComponentInChildren<ForceDetector>().gameObject;
|
|
_rulesetDetector = _detectorObj.GetComponent<RulesetDetector>();
|
|
}
|
|
|
|
public void SetState(bool state)
|
|
{
|
|
if (state)
|
|
{
|
|
gameObject.SetActive(true);
|
|
gameObject.Show();
|
|
return;
|
|
}
|
|
|
|
gameObject.Hide();
|
|
}
|
|
}
|
|
} |