예제 #1
0
        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;
                    }
                }
            }
        }
예제 #2
0
파일: Before.cs 프로젝트: withlin/NConcern
        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);
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        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;
        }
예제 #5
0
        private void OnDisable()
        {
            activeCuttingTarget = null;

            if (playerIKTarget != null)
            {
                playerIKTarget.enabled = true;
            }
        }
예제 #6
0
        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);
            }
        }
예제 #7
0
        /// <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();
        }
예제 #8
0
        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();
            }
        }
예제 #9
0
파일: Program.cs 프로젝트: 845263/Tasks
        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();
        }
예제 #10
0
        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);
            }
        }
예제 #11
0
 /// <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;
예제 #12
0
 public static bool Prefix(Sealed __instance, out bool __state)
 {
     __state = __instance._sealed;
     return(true);
 }
예제 #13
0
 public TakesSealed(Sealed imSealed)
 {
 }