private void UpdateTarget() { activeCuttingTarget = null; if (usingPlayer != null) { Vector3 vector = default(Vector3); GameObject gameObject = null; Vector3 vector2; UWE.Utils.TraceFPSTargetPosition(Player.main.gameObject, 2f, ref gameObject, ref vector, out vector2, true); if (gameObject == null) { InteractionVolumeUser component = Player.main.gameObject.GetComponent <InteractionVolumeUser>(); if (component != null && component.GetMostRecent() != null) { gameObject = component.GetMostRecent().gameObject; } } if (gameObject) { Sealed exists = gameObject.FindAncestor <Sealed>(); if (exists) { activeCuttingTarget = exists; } } } }
public void BasicBeforeSealedMethodStateful() { lock (Interception.Handle) { var _method = Metadata <Sealed> .Method(_Instance => _Instance.Method(Argument <int> .Value, Argument <int> .Value)); var _instance = new Sealed(); Interception.Initialize(); _instance.Method(2, 3); Assert.AreEqual(Interception.Done, false); Aspect.Weave <Before.Interceptor.Parameterized>(_method); Interception.Initialize(); var _return = _instance.Method(2, 3); Assert.AreEqual(_return, 1); Assert.AreEqual(Interception.Done, true); Assert.AreEqual(Interception.Instance, _instance); Assert.AreEqual(Interception.Arguments.Length, 2); Assert.AreEqual(Interception.Arguments[0], 2); Assert.AreEqual(Interception.Arguments[1], 3); Aspect.Release <Before.Interceptor.Parameterized>(_method); Interception.Initialize(); _instance.Method(2, 3); Assert.AreEqual(Interception.Done, false); } }
public static void Postfix(Sealed __instance) { NitroxId id = NitroxEntity.GetId(__instance.gameObject); SealedDoorMetadata doorMetadata = new(__instance._sealed, __instance.openedAmount); Entities entities = NitroxServiceLocator.LocateService <Entities>(); entities.BroadcastMetadataUpdate(id, doorMetadata); }
public override void ProcessMetadata(GameObject gameObject, SealedDoorMetadata metadata) { Log.Info($"Received door metadata change for {gameObject.name} with data of {metadata}"); Sealed door = gameObject.GetComponent <Sealed>(); door._sealed = metadata.Sealed; }
private void OnDisable() { activeCuttingTarget = null; if (playerIKTarget != null) { playerIKTarget.enabled = true; } }
public static void Postfix(Sealed __instance, bool __state) { if (__state != __instance._sealed) { NitroxId id = NitroxEntity.GetId(__instance.gameObject); SealedDoorMetadata doorMetadata = new SealedDoorMetadata(__instance._sealed); Entities entities = NitroxServiceLocator.LocateService <Entities>(); entities.BroadcastMetadataUpdate(id, doorMetadata); } }
/// <summary> /// Tests Sealed.cs /// </summary> public static void Sealed() { Sealed s = new Sealed(); s.PrintSealed(); A a = new A(); a.PrintSealedFunctionInParent(); B b = new B(); b.PrintSealedFunctionInParent(); C c = new C(); c.PrintSealedFunctionInParent(); }
public override void ProcessMetadata(GameObject gameObject, SealedDoorMetadata metadata) { Log.Info($"Received door metadata change for {gameObject.name} with data of {metadata}"); Sealed door = gameObject.GetComponent <Sealed>(); door._sealed = metadata.Sealed; door.openedAmount = metadata.OpenedAmount; LaserCutObject laseredObject = gameObject.GetComponent <LaserCutObject>(); if (laseredObject && door._sealed) { laseredObject.lastCutValue = door.openedAmount; laseredObject.ActivateFX(); } }
public static void Main(string[] args) { //CreateHostBuilder(args).Build().Run(); var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope()) { var services = scope.ServiceProvider; try { Sealed.Initializer(services); } catch (Exception ex) { var logger = services.GetRequiredService <ILogger <Program> >(); logger.LogError(ex, "An error occured while seeding the Db"); } } host.Run(); }
public override int GetHashCode() { unchecked { var hash = 17; hash = hash * 23 + Matching.GetHashCode(); foreach (var type in types) { if (type != null) { hash = hash * 23 + type.GetHashCode(); } } hash = hash * 23 + Value.GetHashCode(); hash = hash * 23 + Reference.GetHashCode(); hash = hash * 23 + Classes.GetHashCode(); hash = hash * 23 + Interfaces.GetHashCode(); hash = hash * 23 + Structs.GetHashCode(); hash = hash * 23 + Enums.GetHashCode(); hash = hash * 23 + Delegates.GetHashCode(); hash = hash * 23 + Public.GetHashCode(); hash = hash * 23 + NonPublic.GetHashCode(); hash = hash * 23 + Abstract.GetHashCode(); hash = hash * 23 + Generic.GetHashCode(); hash = hash * 23 + OpenConstructedGeneric.GetHashCode(); hash = hash * 23 + Static.GetHashCode(); hash = hash * 23 + Sealed.GetHashCode(); hash = hash * 23 + Nested.GetHashCode(); hash = hash * 23 + Primitives.GetHashCode(); hash = hash * 23 + Object.GetHashCode(); hash = hash * 23 + NonSerializable.GetHashCode(); hash = hash * 23 + Obsolete.GetHashCode(); hash = hash * 23 + GenericParameterAttributeFlags.GetHashCode(); return(hash); } }
/// <summary> /// Sets the current cutting target. /// </summary> /// <param name="laserCutter"></param> /// <param name="newTarget"></param> public static void SetActiveCuttingTarget(this LaserCutter laserCutter, Sealed newTarget) => laserCutter.activeCuttingTarget = newTarget;
public static bool Prefix(Sealed __instance, out bool __state) { __state = __instance._sealed; return(true); }
public TakesSealed(Sealed imSealed) { }