new-horizons/NewHorizons/Components/MapSatelliteOrbitFix.cs
2022-03-20 22:22:39 -04:00

23 lines
718 B
C#

using NewHorizons.Builder.General;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace NewHorizons.Components
{
public class MapSatelliteOrbitFix : MonoBehaviour
{
public void Awake()
{
var detector = base.transform.GetComponentInChildren<DynamicForceDetector>();
var ao = base.GetComponent<AstroObject>();
var newDetector = DetectorBuilder.Make(base.gameObject, ao.GetAttachedOWRigidbody(), ao.GetPrimaryBody(), ao, true, false);
newDetector.transform.parent = detector.transform.parent;
GameObject.Destroy(detector);
}
}
}