-
Notifications
You must be signed in to change notification settings - Fork 12
/
MFIManager.cs
28 lines (26 loc) · 1 KB
/
MFIManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Linq;
using UnityEngine;
namespace ModularFlightIntegrator
{
[KSPAddon(KSPAddon.Startup.EveryScene, false)]
public class MFIManager: MonoBehaviour
{
private void Start()
{
var fiw = VesselModuleManager.GetWrapper(typeof (FlightIntegrator));
if (fiw != null && fiw.active)
{
print("[MFIManager] FlightIntegrator is active. Deactivating it");
VesselModuleManager.RemoveModuleOfType(typeof (FlightIntegrator));
}
// Should we display this only if we deactivated the stock FI ?
string msg = "[MFIManager] Current active VesselModule : \n";
foreach (var vesselModuleWrapper in VesselModuleManager.GetModules(false, false))
{
msg += " " + vesselModuleWrapper.type.ToString() + " active=" + vesselModuleWrapper.active +
" order=" + vesselModuleWrapper.order + "\n";
}
print(msg);
}
}
}