Example #1
0
 private void Update()
 {
     if ((!BoltNetwork.isRunning || BoltNetwork.isServer) && this.raftPush.InWater && this.raftMainBody.constraints != RigidbodyConstraints.None)
     {
         this.raftMainBody.constraints = RigidbodyConstraints.None;
     }
     if (this.enteredTransform && (!BoltNetwork.isRunning || !base.state.GrabbedBy) && !LocalPlayer.AnimControl.swimming)
     {
         if (!this.billboardIcon.activeSelf)
         {
             this.billboardIcon.SetActive(true);
         }
         if (TheForest.Utils.Input.GetButtonDown("Take"))
         {
             Vector3 vector = this.raftMainTransform.position - this.enteredTransform.position;
             if (BoltNetwork.isRunning)
             {
                 PushRaft pushRaft = global::PushRaft.Create(GlobalTargets.OnlyServer);
                 pushRaft.Direction = vector;
                 pushRaft.Raft      = this.entity;
                 pushRaft.Send();
             }
             else
             {
                 this.PushRaft(vector);
             }
         }
     }
     else if (this.billboardIcon.activeSelf)
     {
         this.billboardIcon.SetActive(false);
     }
 }
Example #2
0
 public override void OnEvent(PushRaft evnt)
 {
     if (evnt.Raft.IsAttached())
     {
         Component[] componentsInChildren = evnt.Raft.GetComponentsInChildren(typeof(CoopRaftPusher2), true);
         if (componentsInChildren.Length > 0)
         {
             (componentsInChildren[0] as CoopRaftPusher2).PushRaft(evnt.Direction);
         }
     }
 }
Example #3
0
    private void Update()
    {
        if ((!BoltNetwork.isRunning || BoltNetwork.isServer) && this.raftPush.InWater && this.raftMainBody.constraints != RigidbodyConstraints.None)
        {
            this.raftMainBody.constraints = RigidbodyConstraints.None;
        }
        if (this.enteredTransform && this.raftMainTransform)
        {
            float magnitude = (this.raftMainTransform.position - this.enteredTransform.position).magnitude;
            if (magnitude > 30f || (this.enteredTransform.tag != "Player" && this.enteredTransform.tag != "PlayerNet"))
            {
                this.forcePlayerExit();
            }
        }
        if (this.enteredTransform && LocalPlayer.AnimControl && !LocalPlayer.AnimControl.swimming && !Grabber.IsFocused && !this.IsUpsideDown)
        {
            if (BoltNetwork.isRunning)
            {
                if (base.state.GrabbedBy.Any((BoltEntity g) => g))
                {
                    goto IL_1B8;
                }
            }
            if (!this.billboardIconPush.activeSelf)
            {
                this.billboardIconPush.SetActive(true);
            }
            if (TheForest.Utils.Input.GetButtonDown("Take"))
            {
                if (BoltNetwork.isRunning)
                {
                    PushRaft pushRaft = global::PushRaft.Create(GlobalTargets.OnlyServer);
                    pushRaft.Direction = this.GetPushDirection();
                    pushRaft.Raft      = base.entity;
                    pushRaft.Send();
                }
                else
                {
                    this.PushRaft(this.GetPushDirection());
                }
            }
            return;
        }
IL_1B8:
        if (this.billboardIconPush.activeSelf)
        {
            this.billboardIconPush.SetActive(false);
        }
    }
 public override void OnEvent(PushRaft evnt)
 {
     if (evnt.Raft.IsAttached())
     {
         Component[] componentsInChildren = evnt.Raft.GetComponentsInChildren(typeof(CoopRaftPusher2), true);
         if (componentsInChildren.Length > 0)
         {
             (componentsInChildren[0] as CoopRaftPusher2).PushRaft(evnt.Direction);
         }
     }
 }