mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
46 lines
1.4 KiB
C#
46 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace NewHorizons.Components.Orbital
|
|
{
|
|
public class BinaryFocalPoint : MonoBehaviour
|
|
{
|
|
public string PrimaryName { get; set; }
|
|
public string SecondaryName { get; set; }
|
|
|
|
public AstroObject Primary { get; set; }
|
|
public AstroObject Secondary { get; set; }
|
|
|
|
public GameObject FakeMassBody { get; set; }
|
|
|
|
void Awake()
|
|
{
|
|
FakeMassBody.SetActive(true);
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
// Secondary and primary must have been engulfed by a star
|
|
if(!Primary.isActiveAndEnabled && !Secondary.isActiveAndEnabled)
|
|
{
|
|
ReferenceFrameTracker component = Locator.GetPlayerBody().GetComponent<ReferenceFrameTracker>();
|
|
if (component.GetReferenceFrame(true) != null && component.GetReferenceFrame(true).GetOWRigidBody() == gameObject)
|
|
{
|
|
component.UntargetReferenceFrame();
|
|
}
|
|
MapMarker component2 = gameObject.GetComponent<MapMarker>();
|
|
if (component2 != null)
|
|
{
|
|
component2.DisableMarker();
|
|
}
|
|
gameObject.SetActive(false);
|
|
FakeMassBody.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
}
|