new-horizons/Marshmallow/General/MakeMapMarker.cs
2020-06-08 22:57:45 +01:00

19 lines
591 B
C#

using OWML.ModHelper.Events;
using System.Reflection;
using UnityEngine;
namespace Marshmallow.General
{
static class MakeMapMarker
{
public static void Make(GameObject body, string name)
{
var MM = body.AddComponent<MapMarker>();
MM.SetValue("_labelID", (UITextType)Utility.AddToUITable.Add(name));
MM.SetValue("_markerType", MM.GetType().GetNestedType("MarkerType", BindingFlags.NonPublic).GetField("Planet").GetValue(MM));
Main.Log("Map Marker - body : " + body.name + ", labelID : " + name);
}
}
}