![]() | ILinkSourcelinkTarget Property |
Namespace: KASAPIv2
ILinkTarget linkTarget { get; }
// Returns the linked part of the source, if any. It assumes there is exactly one source module // on the source part. public static Part FindTargetFromSource(Part srcPart) { var source = srcPart.FindModulesImplementing<ILinkSource>() .FirstOrDefault(s => s.linkTarget != null); if (source == null) { Debug.Log("Source is not connected"); return null; } return source.linkTarget.part; }