public static void Postfix(StarshipDoor __instance)
        {
            NitroxId             id = NitroxEntity.GetId(__instance.gameObject);
            StarshipDoorMetadata starshipDoorMetadata = new(__instance.doorLocked, __instance.doorOpen);
            Entities             entities             = NitroxServiceLocator.LocateService <Entities>();

            entities.BroadcastMetadataUpdate(id, starshipDoorMetadata);
        }
Ejemplo n.º 2
0
        public override void ProcessMetadata(GameObject gameObject, StarshipDoorMetadata metadata)
        {
            StarshipDoor starshipDoor = gameObject.GetComponent <StarshipDoor>();

            starshipDoor.doorOpen   = metadata.DoorOpen;
            starshipDoor.doorLocked = metadata.DoorLocked;
            if (metadata.DoorLocked)
            {
                starshipDoor.LockDoor();
            }
            else
            {
                starshipDoor.UnlockDoor();
            }
        }