private void Awake() { base.enabled = false; this._state = CraneTrigger.States.Idle; this._climbHash = Animator.StringToHash("climbing"); this._climbIdleHash = Animator.StringToHash("climbIdle"); }
private void Update() { if (LocalPlayer.FpCharacter.PushingSled) { return; } if (TheForest.Utils.Input.GetButtonDown("Take")) { this._state = ((this._state != CraneTrigger.States.Idle) ? CraneTrigger.States.Idle : CraneTrigger.States.Locked); } else if (this._state == CraneTrigger.States.Locked) { float axis = TheForest.Utils.Input.GetAxis("Vertical"); if (!Mathf.Approximately(axis, 0f)) { if (axis < 0f) { this._platformTr.localPosition += new Vector3(0f, -this._moveSpeed * Time.deltaTime, 0f); if (this._platformTr.localPosition.y < -this._maxHeight) { this._platformTr.localPosition = new Vector3(this._platformTr.localPosition.x, -this._maxHeight, this._platformTr.localPosition.z); } } else { this._platformTr.localPosition += new Vector3(0f, this._moveSpeed * Time.deltaTime, 0f); if (this._platformTr.localPosition.y > 0f) { this._platformTr.localPosition = new Vector3(this._platformTr.localPosition.x, 0f, this._platformTr.localPosition.z); } } for (int i = 0; i < this._ropes.Length; i++) { this._ropes[i].LookAt(this._ropeTargets[i]); } } } }