Beispiel #1
0
        private void Update()
        {
            bool flag = LocalPlayer.Inventory.RightHand && this._itemIdWhiteList.Contains(LocalPlayer.Inventory.RightHand._itemId);

            if (flag)
            {
                this._sheenBillboard.SetActive(false);
                this._pickupBillboard.SetActive(true);
                int itemId = LocalPlayer.Inventory.RightHand._itemId;
                if (TheForest.Utils.Input.GetButtonAfterDelay("Take", 0.5f, false) && LocalPlayer.Inventory.RemoveItem(itemId, 1, false, true))
                {
                    LocalPlayer.Sfx.PlayTwinkle();
                    if (BoltNetwork.isRunning)
                    {
                        PlaceTrophy placeTrophy = global::PlaceTrophy.Create(GlobalTargets.OnlyServer);
                        placeTrophy.Maker  = base.entity;
                        placeTrophy.ItemId = itemId;
                        placeTrophy.Send();
                        EventRegistry.Achievements.Publish(TfEvent.Achievements.CreatedTrophy, itemId);
                    }
                    else
                    {
                        this.PlaceTrophy(itemId);
                        EventRegistry.Achievements.Publish(TfEvent.Achievements.CreatedTrophy, itemId);
                    }
                }
            }
            else
            {
                this._sheenBillboard.SetActive(true);
                this._pickupBillboard.SetActive(false);
                base.enabled = false;
            }
        }
Beispiel #2
0
 public override void OnEvent(PlaceTrophy evnt)
 {
     if (evnt.Maker)
     {
         TrophyMaker[] componentsInChildren = evnt.Maker.GetComponentsInChildren <TrophyMaker>(true);
         if (componentsInChildren.Length > 0)
         {
             componentsInChildren[0].PlaceTrophy(evnt.ItemId);
         }
     }
 }
 public override void OnEvent(PlaceTrophy evnt)
 {
     if (evnt.Maker)
     {
         TrophyMaker[] componentsInChildren = evnt.Maker.GetComponentsInChildren<TrophyMaker>(true);
         if (componentsInChildren.Length > 0)
         {
             componentsInChildren[0].PlaceTrophy(evnt.ItemId);
         }
     }
 }