public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Source.Parent is Hands hands) { hands.PlaceHeldItem(interactionEvent.Point); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Source.Parent is Hands hands) { hands.PlaceHeldItem(interactionEvent.Point, hands.GetItemInHand().transform.rotation); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Target is DisposalBin disposal) { // Calls the dispose method on the bin disposal.DisposeContents(); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { var inventory = interactionEvent.Source.GetComponentInTree <Inventory>(); var attachedContainer = interactionEvent.Target.GetComponent <AttachedContainer>(); inventory.OpenContainer(attachedContainer); return(false); }
public static int GetPageViewsCount(string itemId) { int counter = 0; using (var client = XConnectHelper.GetClient()) { try { IAsyncQueryable <Sitecore.XConnect.Contact> queryable = client.Contacts .Where(c => c.Interactions.Any(f => f.Events.OfType <PageViewEvent>().Any())) .WithExpandOptions(new Sitecore.XConnect.ContactExpandOptions() { Interactions = new Sitecore.XConnect.RelatedInteractionsExpandOptions() { Limit = 2000 // Returns top 20 of all contact's interactions - interactions not affected by query } }); var enumerable = queryable.GetBatchEnumeratorSync(10); var urlList = new List <string>(); while (enumerable.MoveNext()) { foreach (var contact in enumerable.Current) { InteractionReference interactionReference = new InteractionReference((Guid)contact.Id, (Guid)contact.Interactions.ElementAt(0).Id); Interaction interaction = client.Get <Interaction>(interactionReference, new InteractionExpandOptions(new string[] { IpInfo.DefaultFacetKey }) { Contact = new RelatedContactExpandOptions(new string[] { PersonalInformation.DefaultFacetKey }) }); var pageViews = interaction.Events.OfType <PageViewEvent>().OrderBy(ev => ev.Timestamp).ToList(); foreach (var page in pageViews) { // item id is in page if (page.ItemId.Equals(Guid.Parse(itemId))) { counter++; } urlList.Add(page.Url); } Console.WriteLine("Page Url: " + pageViews.FirstOrDefault().Url); } } //var count = urlList.GroupBy(x => x).Select(y => new { } x.Count()); var count = urlList.GroupBy(n => n).Select(c => new { Key = c.Key, total = c.Count() }); return(counter); } catch (XdbExecutionException ex) { } return(counter); } }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { GameObject target = ((IGameObjectProvider)interactionEvent.Target).GameObject; Animator animator = target.GetComponent <Animator>(); bool open = animator.GetBool(OpenId); animator.SetBool(OpenId, !open); OnOpenStateChange(!open); return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { // we check if the source of the interaction is a hand if (interactionEvent.Source.Parent is Hands hands) { // we place the item in the hand in the point we clicked hands.PlaceHeldItem(interactionEvent.Point, hands.ItemInHand.transform.rotation); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { // remember that when we call this Start, we are starting the interaction per se // so we check if the source of the interaction is a Hand, and if the target is an Item if (interactionEvent.Source is Hands hands && interactionEvent.Target is Item target) { // and then we run the function that adds it to the container hands.Pickup(target); } return(false); }
private void Toggle(InteractionEvent interactionEvent, InteractionReference reference) { on = !on; animator.SetBool(OnHash, on); foreach (Light light in lights) { light.enabled = on; } RpcToggle(on); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Target is Bikehorn horn) { horn.Honk(); } if (interactionEvent.Source is Bikehorn horn1) { horn1.Honk(); } return(false); }
public virtual bool Start(InteractionEvent interactionEvent, InteractionReference reference) { Hands hands = (Hands)interactionEvent.Source; Item PickupItem = interactionEvent.Target.GetComponent <AttachedContainer>().Container.StoredItems[0].Item; if (PickupItem != null) { hands.Pickup(PickupItem); } return(false); }
public virtual bool Start(InteractionEvent interactionEvent, InteractionReference reference) { Hands hands = (Hands)interactionEvent.Source; int index = containerDescriptor.attachedContainer.Container.StoredItems.Count - 1; Item PickupItem = containerDescriptor.attachedContainer.Container.StoredItems[index].Item; if (PickupItem != null) { hands.Pickup(PickupItem); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Target is IToggleable toggle1) { toggle1.Toggle(); } else if (interactionEvent.Source is IToggleable toggle) { toggle.Toggle(); } return(false); }
private void Toggle(InteractionEvent interactionEvent, InteractionReference reference) { on = !on; foreach (Light light in lights) { light.enabled = on; } bulbRenderer.material = on ? onMaterial : offMaterial; RpcToggle(on); }
private void ModeInteract(InteractionEvent interactionEvent, InteractionReference arg2) { if (mode == OperatingMode.Scrubbing) { mode = OperatingMode.Siphoning; siphonActive = true; } else if (mode == OperatingMode.Siphoning) { mode = OperatingMode.Scrubbing; siphonActive = false; } }
private void ModeInteract(InteractionEvent interactionEvent, InteractionReference arg2) { if (mode == OperatingMode.Internal) { mode = OperatingMode.External; internalActive = false; } else if (mode == OperatingMode.External) { mode = OperatingMode.Internal; internalActive = true; } }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Source is IGameObjectProvider provider) { SubstanceContainer container = provider.GameObject.GetComponent <SubstanceContainer>(); if (container != null) { container.AddSubstance(Substance.Substance, Substance.Moles); container.MarkDirty(); } } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (interactionEvent.Source is IGameObjectProvider provider) { SubstanceContainer container = provider.GameObject.GetComponent <SubstanceContainer>(); if (container != null) { var targetContainer = interactionEvent.Target.GetComponent <SubstanceContainer>(); container.TransferVolume(targetContainer, 25); container.MarkDirty(); targetContainer.MarkDirty(); } } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { GameObject source = ((IGameObjectProvider)interactionEvent.Source.GetRootSource()).GameObject; GameObject target = ((IGameObjectProvider)interactionEvent.Target).GameObject; Inventory inventory = source.GetComponent <Inventory>(); if (!inventory.HasContainer(target)) { var attacher = source.AddComponent <ContainerAttachment>(); attacher.container = target.GetComponent <Container>(); attacher.inventory = inventory; attacher.range = MaxDistance; } else { inventory.RemoveContainer(target); } return(false); }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { if (!InteractionExtensions.RangeCheck(interactionEvent)) { return(false); } if (!(interactionEvent.Target is IIgnitable ignitable)) { return(false); } if (ignitable.Lit) { ignitable.Extinguish(); } else { ignitable.Ignite(); } return(false); }
private void PumpInteract(InteractionEvent interactionEvent, InteractionReference arg2) { SetActive(!pumpActive); }
private void FilterInteract(InteractionEvent interactionEvent, InteractionReference arg2) { SetActive(!filterActive); }
public override void Cancel(InteractionEvent interactionEvent, InteractionReference reference) { }
public bool Start(InteractionEvent interactionEvent, InteractionReference reference) { return(false); }
private void ActiveInteract(InteractionEvent interactionEvent, InteractionReference arg2) { deviceActive = !deviceActive; }
private void ValveInteract(InteractionEvent interactionEvent, InteractionReference arg2) { valveOpen = !valveOpen; //canisterUI.gameObject.SetActive(true); }
private void IncreasePressure(InteractionEvent interactionEvent, InteractionReference arg2) { valvePressure += 20; }
public bool Update(InteractionEvent interactionEvent, InteractionReference reference) { throw new System.NotImplementedException(); }
public void Cancel(InteractionEvent interactionEvent, InteractionReference reference) { throw new System.NotImplementedException(); }
private void ValveInteract(InteractionEvent interactionEvent, InteractionReference arg2) { SetValve(!isEnabled); }