diff --git a/CHANGES.md b/CHANGES.md index 25867e5d..90cfadf7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ ## 0.5.8.3 -> * Fix type check of field assign using operators `+=`, `-=` ... (#114) +* Add unique id to `ksp::vessel::Part` (#165) ## 0.5.7.9 -> 0.5.8.3 diff --git a/KSP2Runtime/KSPVessel/KSPVesselModule.Part.cs b/KSP2Runtime/KSPVessel/KSPVesselModule.Part.cs index 130bda6f..4d0a8345 100644 --- a/KSP2Runtime/KSPVessel/KSPVesselModule.Part.cs +++ b/KSP2Runtime/KSPVessel/KSPVesselModule.Part.cs @@ -19,6 +19,9 @@ internal PartAdapter(VesselAdapter vesselAdapter, PartComponent part) : base(par this.vesselAdapter = vesselAdapter; } + [KSField(Description = "Unique part id. Note: this will be different for each vessel.")] + public string Id => part.GlobalId.ToString(); + [KSField] public PartCategories PartCategory => part.PartData.category; [KSField] public string PartTitle => part.PartData.Title;