public override void OnEvent(SledGrab evnt) { if (evnt.Player && evnt.Sled) { IMultiHolderState state = evnt.Sled.GetState <IMultiHolderState>(); if (!state.GrabbedBy) { state.GrabbedBy = evnt.Player; } } }
private void Update() { if (!this.playerCanGrabSled()) { this.Sheen.SetActive(false); this.MyPickUp.SetActive(false); return; } this.Sheen.SetActive(false); this.MyPickUp.SetActive(true); if (!this.onSled && !this.coolDown && this.inTrigger && !LocalPlayer.IsInCaves && this.distanceCheck && TheForest.Utils.Input.GetButtonAfterDelay("Take", 0.5f, false)) { if (BoltNetwork.isRunning) { if (this.CanGrabThisSled()) { this.Sheen.SetActive(false); this.MyPickUp.SetActive(false); SledGrab sledGrab = SledGrab.Create(GlobalTargets.OnlyServer); sledGrab.Player = LocalPlayer.Entity; sledGrab.Sled = base.GetComponentInParent <BoltEntity>(); sledGrab.Send(); } } else { this.enableSled(); } } else if (this.onSled) { if (!this.coolDown && this.inTrigger && TheForest.Utils.Input.GetButtonDown("Take")) { base.StartCoroutine(this.disableSled(false)); } else if (LocalPlayer.PlayerPushSledAction.currentSled != base.transform) { base.StartCoroutine(this.disableSled(false)); } } else if ((!this.inTrigger || Grabber.FocusedItemGO != base.gameObject) && !this.coolDown) { this.GrabExit(); } if (this.onSled) { if (this.flagTrigger.activeSelf) { this.flagTrigger.SetActive(false); } if (!this.hideScript.enabled) { this.hideScript.enabled = true; } } else { if (!this.flagTrigger.activeSelf) { this.flagTrigger.SetActive(true); } if (this.hideScript.enabled) { this.hideScript.enabled = false; } } }
public override void OnEvent(SledGrab evnt) { if (evnt.Player && evnt.Sled) { IMultiHolderState state = evnt.Sled.GetState<IMultiHolderState>(); if (!state.GrabbedBy) { state.GrabbedBy = evnt.Player; } } }