public static void Postfix(PrecursorTeleporter __instance) { NitroxId id = NitroxEntity.GetId(__instance.gameObject); PrecursorTeleporterMetadata precursorTeleporterMetadata = new PrecursorTeleporterMetadata(__instance.isOpen); Entities entities = NitroxServiceLocator.LocateService <Entities>(); entities.BroadcastMetadataUpdate(id, precursorTeleporterMetadata); }
private static void Postfix(PrecursorTeleporter __instance) { if (once) { return; } once = true; Logger.Log("Teleporter:"); ModUtils.PrintObject(__instance.gameObject); }
public override void ProcessMetadata(GameObject gameObject, PrecursorTeleporterMetadata metadata) { Log.Debug($"Received precursor teleporter metadata change for {gameObject.name} with data of {metadata}"); PrecursorTeleporter precursorTeleporter = gameObject.GetComponent <PrecursorTeleporter>(); if (precursorTeleporter) { precursorTeleporter.ToggleDoor(metadata.IsOpen); } }