private void UpdateHook() { if (!this.m_Hook) { return; } bool flag = FishingController.Get().m_State != FishingController.State.Cast; if (this.m_Hook.gameObject.activeSelf != flag) { this.m_Hook.gameObject.SetActive(flag); } this.m_Hook.m_BaitSlot.gameObject.SetActive((Inventory3DManager.Get() && Inventory3DManager.Get().IsActive()) || this.m_Hook.m_Bait); if (this.m_Hook.m_BaitSlot.gameObject.activeSelf && !this.m_Hook.m_BaitSlot.m_Active) { this.m_Hook.m_BaitSlot.Activate(); } if (!flag) { return; } if (this.m_State == FishingRod.State.Fishing || this.m_State == FishingRod.State.Strike || this.m_State == FishingRod.State.Cancel) { this.m_Hook.transform.rotation = this.m_Float.transform.rotation; this.m_Hook.transform.position = this.m_HookInWaterPos; return; } this.m_Hook.transform.localRotation = Quaternion.identity; this.m_Hook.transform.localPosition = Vector3.zero; }
private void Jump() { if (!this.CanJump()) { return; } this.m_WantedSpeed.target.y = (this.m_WantedSpeed.current.y = this.m_JumpSpeed); this.m_Player.DecreaseStamina(StaminaDecreaseReason.Jump); EventsManager.OnEvent(Enums.Event.Jump, 1); this.m_AudioModule.PlayFeetJumpSound(1f, false); this.m_AudioModule.PlayJumpSound(); if (FishingController.Get().IsActive()) { FishingController.Get().OnJump(); } if (WeaponSpearController.Get().IsActive()) { WeaponSpearController.Get().Jump(); } else { this.m_Animator.SetTrigger(this.m_TJump); } this.m_JumpInProgress = true; }
private void OnDestroy() { if (!Player.Get()) { return; } if (FishingController.Get() && FishingController.Get().IsActive() && FishingController.Get().m_FishingRod == this) { Player.Get().SetCurrentItem(Hand.Right, null); Player.Get().SetWantedItem(Hand.Right, null, true); Player.Get().StopController(PlayerControllerType.Fishing); } }
private void UpdateVein() { switch (FishingController.Get().m_State) { case FishingController.State.Waiting: case FishingController.State.Fail: case FishingController.State.Presentation: this.m_Vein.transform.position = this.m_Float.transform.position; this.m_VeinElement.SetActive(false); return; case FishingController.State.Reel: case FishingController.State.Strike: this.m_Vein.transform.position = (this.m_HideVein ? this.m_Top.transform.position : this.m_Float.transform.position); this.m_VeinElement.SetActive(false); return; } this.m_Vein.transform.position = this.m_Top.transform.position; this.m_VeinElement.SetActive(true); }
private void UpdateHook() { if (FishingController.Get().m_State == FishingController.State.Cast || FishingController.Get().m_State == FishingController.State.Aim) { if (this.m_Hook.gameObject.activeSelf) { this.m_Hook.gameObject.SetActive(false); } } else if (!this.m_Hook.gameObject.activeSelf) { this.m_Hook.gameObject.SetActive(true); } if (this.m_State == FishingRod.State.None && this.m_Hook.gameObject.activeSelf) { Vector3 vector = this.m_Top.transform.position + Vector3.down * 1f; vector.y = Mathf.Max(vector.y, MainLevel.GetTerrainY(vector) + 0.2f); this.m_Hook.transform.position = vector; } }
private void UpdateVein() { FishingController fishingController = FishingController.Get(); switch (fishingController.m_State) { case FishingController.State.None: case FishingController.State.Waiting: case FishingController.State.Strike: case FishingController.State.Reel: case FishingController.State.Fish: this.m_Vein.transform.position = this.m_Hook.transform.position; break; case FishingController.State.Aim: case FishingController.State.Cast: this.m_Vein.transform.position = this.m_Top.transform.position; break; } }