Example #1
0
 private void handleRemoveItem(PartyGameSessionMessages.RemoveItem removeItemData)
 {
     if (itemIdToItemGameObject.ContainsKey(removeItemData.ItemId))
     {
         hudUI.FoundItem();
         Service.Get <EventDispatcher>().DispatchEvent(new ScavengerHuntEvents.RemoveMarble(itemIdToItemGameObject[removeItemData.ItemId].transform));
         if (role == ScavengerHuntRoles.Finder)
         {
             scavengerHuntData.LocalPlayerAnimator.ResetTrigger("TorsoAction1");
             scavengerHuntData.LocalPlayerAnimator.SetTrigger("TorsoAction1");
         }
         else
         {
             scavengerHuntData.OtherPlayerAnimator.ResetTrigger("TorsoAction1");
             scavengerHuntData.OtherPlayerAnimator.SetTrigger("TorsoAction1");
         }
         Object.Destroy(itemIdToItemGameObject[removeItemData.ItemId]);
         itemIdToItemGameObject.Remove(removeItemData.ItemId);
         totalItemsFound++;
         if (role == ScavengerHuntRoles.Finder)
         {
             logItemFoundBi();
         }
     }
 }
Example #2
0
        private bool onItemInteractionStarted(PenguinInteraction.InteractionStartedEvent evt)
        {
            if (evt.InteractingPlayerId != localPlayerSessionId || role != ScavengerHuntRoles.Finder || currentState != ScavengerHuntState.Finding)
            {
                return(false);
            }
            PartyGameInteractibleProperties componentInChildren = evt.ObjectInteractedWith.GetComponentInChildren <PartyGameInteractibleProperties>();

            if (componentInChildren != null && itemIdToItemGameObject.ContainsKey(componentInChildren.ItemId))
            {
                PartyGameSessionMessages.RemoveItem data = new PartyGameSessionMessages.RemoveItem(componentInChildren.ItemId);
                sendSessionMessage(PartyGameSessionMessageTypes.RemoveItem, data);
            }
            return(false);
        }