103 lines
2.2 KiB
C#
103 lines
2.2 KiB
C#
using UnityEngine;
|
|
|
|
public class HandsAnimEvents : MonoBehaviour
|
|
{
|
|
public FPlayer player;
|
|
|
|
private Animator animator;
|
|
|
|
private void Start()
|
|
{
|
|
animator = GetComponent<Animator>();
|
|
}
|
|
|
|
public void UnlockReel()
|
|
{
|
|
if ((bool)player)
|
|
{
|
|
player.currentRod.currentReel.LockUnlockKablag();
|
|
animator.SetBool("RHandReelUnlock", value: false);
|
|
animator.SetBool("RHandReelLock", value: false);
|
|
}
|
|
}
|
|
|
|
public void UnlockReelWithHandAnimation()
|
|
{
|
|
if ((bool)player)
|
|
{
|
|
player.UnlockLockReel();
|
|
}
|
|
}
|
|
|
|
public void ResetThrow()
|
|
{
|
|
animator.SetBool("RHandThrowFar", value: false);
|
|
animator.SetBool("RHandThrowNear", value: false);
|
|
}
|
|
|
|
public void BlockLineByFinger()
|
|
{
|
|
if ((bool)player && (bool)player.currentRod && player.fishingMode != FPlayer.FishingMode.Manual)
|
|
{
|
|
player.currentRod.currentReel.isBlockLineByFinger = true;
|
|
}
|
|
}
|
|
|
|
public void UnBlockLineByFinger()
|
|
{
|
|
if ((bool)player && player.fishingMode != FPlayer.FishingMode.Manual && (bool)player.currentRod)
|
|
{
|
|
if (player.currentRod.throwForcePower > 0f)
|
|
{
|
|
player.currentRod.ForceThrow();
|
|
}
|
|
player.currentRod.currentReel.isBlockLineByFinger = false;
|
|
}
|
|
}
|
|
|
|
public void UnBlockLineByFingerNear()
|
|
{
|
|
if ((bool)player && player.fishingMode != FPlayer.FishingMode.Manual && (bool)player.currentRod)
|
|
{
|
|
if (player.currentRod.throwForcePower > 0f)
|
|
{
|
|
player.currentRod.ForceThrow(isNear: true);
|
|
}
|
|
player.currentRod.currentReel.isBlockLineByFinger = false;
|
|
player.OutLineFromLeftHandHelper(player.currentRod.fishingLine.currentLineHandler.LineConnector_1.transform);
|
|
}
|
|
}
|
|
|
|
public void PutHandOnReel()
|
|
{
|
|
if ((bool)player && player.currentRod.fishingLine.currentLineHandler.PhisicsLineOut > 0f && !player.currentRod.currentReel.isHandOnHandle)
|
|
{
|
|
player.InteractiveLeftHand(player.currentRod.currentReel.handle);
|
|
}
|
|
}
|
|
|
|
public void CatchFish()
|
|
{
|
|
player.currentRod.CastFish();
|
|
}
|
|
|
|
public void DestroyCurrentFish()
|
|
{
|
|
player.currentRod.DestroyCurrentFish();
|
|
}
|
|
|
|
public void ShowFishPanel()
|
|
{
|
|
FScriptsHandler.Instance.m_HudManager.ShowHideFishCatchPanel();
|
|
}
|
|
|
|
public void DestroyRod()
|
|
{
|
|
if ((bool)player && (bool)player.currentRod)
|
|
{
|
|
Object.Destroy(player.currentRod.gameObject);
|
|
player.currentRod = null;
|
|
}
|
|
}
|
|
}
|