Ejemplo n.º 1
0
        public static Mount GetMount(int?netId, int?mountId)
        {
            if (!netId.HasValue || !mountId.HasValue)
            {
                return(null);
            }

            var mounts = UnifiedNetTools.FindComponentByNetId <MountsLookup>(netId.Value);

            if (mounts)
            {
                return(mounts.mountIdLookup[mountId.Value]);
            }

            return(null);
        }
        public override bool OnSnapshot(int frameId)
        {
            bool ready = base.OnSnapshot(frameId);

            if (!ready)
            {
                return(false);
            }


            int?snapTriggeredById = snapFrame.triggeredById;

            /// If there was a trigger this tick
            //if (!ReferenceEquals(snapTriggeredById, null))
            {
                IVitalsComponent attachedTo;
                attachedTo = (snapTriggeredById == null) ? null : UnifiedNetTools.FindComponentByNetId <IVitalsComponent>(snapTriggeredById.Value);
                SnapshotTrigger(new ContactEvent(null, attachedTo, null, null, ContactType.Enter));
            }

            return(true);
        }