提交修改
This commit is contained in:
@@ -90,6 +90,8 @@ namespace NBF
|
||||
{
|
||||
}
|
||||
|
||||
#region 鱼线操作
|
||||
|
||||
public void TakeLine()
|
||||
{
|
||||
if (Player == null) return;
|
||||
@@ -124,6 +126,71 @@ namespace NBF
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 鱼竿操作
|
||||
|
||||
protected void RodUpDown()
|
||||
{
|
||||
PlayerState ret = PlayerState.None;
|
||||
var isUpRod = false;
|
||||
var isSubLine = false;
|
||||
|
||||
if (InputManager.IsOp1)
|
||||
{
|
||||
if (!Player.IsLureRod)
|
||||
{
|
||||
//抬杆
|
||||
isUpRod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//收线
|
||||
isSubLine = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (InputManager.IsOp2)
|
||||
{
|
||||
if (Player.IsLureRod)
|
||||
{
|
||||
//抬杆
|
||||
isUpRod = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isUpRod || PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp > 0)
|
||||
{
|
||||
var upForce = 1;
|
||||
var addNum = upForce * Time.deltaTime;
|
||||
if (!isUpRod)
|
||||
{
|
||||
addNum *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
addNum *= 0.5f;
|
||||
}
|
||||
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp += addNum;
|
||||
Debug.Log($"addNum={addNum} ishingFinal={PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp}");
|
||||
if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 1)
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 1;
|
||||
}
|
||||
else if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp < 0)
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public FRod GetRod()
|
||||
{
|
||||
var view = Player.GetComponent<PlayerView>();
|
||||
|
||||
@@ -2,5 +2,28 @@
|
||||
{
|
||||
public class PlayerStageViewFight : PlayerStageViewBase
|
||||
{
|
||||
protected override void OnEnter()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnExit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
PlayerState ret = PlayerState.None;
|
||||
RodUpDown();
|
||||
|
||||
if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 0.8f)
|
||||
{
|
||||
// ret = CheckTackFish();
|
||||
}
|
||||
|
||||
if (ret != PlayerState.None)
|
||||
{
|
||||
Player.ChangeState(ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,86 +12,96 @@ namespace NBF
|
||||
|
||||
protected override void OnExit()
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.BaitThrown = false;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
PlayerState ret = PlayerState.None;
|
||||
var isUpRod = false;
|
||||
var isSubLine = false;
|
||||
RodUpDown();
|
||||
|
||||
if (InputManager.IsOp1)
|
||||
if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 0.8f)
|
||||
{
|
||||
if (!Player.IsLureRod)
|
||||
{
|
||||
//抬杆
|
||||
isUpRod = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//收线
|
||||
isSubLine = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (InputManager.IsOp2)
|
||||
{
|
||||
if (Player.IsLureRod)
|
||||
{
|
||||
//抬杆
|
||||
isUpRod = true;
|
||||
}
|
||||
}
|
||||
|
||||
//Player.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
|
||||
if (isUpRod || PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp > 0)
|
||||
{
|
||||
var upForce = 1;
|
||||
var addNum = upForce * Time.deltaTime;
|
||||
if (!isUpRod)
|
||||
{
|
||||
addNum *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
addNum *= 0.5f;
|
||||
}
|
||||
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp += addNum;
|
||||
Debug.Log($"addNum={addNum} ishingFinal={PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp}");
|
||||
// Debug.LogError($"ishingFinal={PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp}");
|
||||
if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 1)
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 1;
|
||||
}
|
||||
else if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp < 0)
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
}
|
||||
|
||||
if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 0.8f)
|
||||
{
|
||||
ret = CheckTackFish();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
ret = CheckTackFish();
|
||||
}
|
||||
|
||||
if (ret != PlayerState.None)
|
||||
{
|
||||
Player.ChangeState(ret);
|
||||
}
|
||||
|
||||
// var isUpRod = false;
|
||||
// var isSubLine = false;
|
||||
//
|
||||
// if (InputManager.IsOp1)
|
||||
// {
|
||||
// if (!Player.IsLureRod)
|
||||
// {
|
||||
// //抬杆
|
||||
// isUpRod = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //收线
|
||||
// isSubLine = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (InputManager.IsOp2)
|
||||
// {
|
||||
// if (Player.IsLureRod)
|
||||
// {
|
||||
// //抬杆
|
||||
// isUpRod = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (isUpRod || PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp > 0)
|
||||
// {
|
||||
// var upForce = 1;
|
||||
// var addNum = upForce * Time.deltaTime;
|
||||
// if (!isUpRod)
|
||||
// {
|
||||
// addNum *= -1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// addNum *= 0.5f;
|
||||
// }
|
||||
//
|
||||
// PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp += addNum;
|
||||
// Debug.Log($"addNum={addNum} ishingFinal={PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp}");
|
||||
// if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 1)
|
||||
// {
|
||||
// PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 1;
|
||||
// }
|
||||
// else if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp < 0)
|
||||
// {
|
||||
// PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
// }
|
||||
//
|
||||
// if (PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp >= 0.8f)
|
||||
// {
|
||||
// ret = CheckTackFish();
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// PlayerView.Unity.ModelAsset.PlayerAnimator.FishingUp = 0;
|
||||
// }
|
||||
//
|
||||
// if (ret != PlayerState.None)
|
||||
// {
|
||||
// Player.ChangeState(ret);
|
||||
// }
|
||||
}
|
||||
|
||||
#region 检查上鱼或者返回待机
|
||||
|
||||
private PlayerState CheckTackFish()
|
||||
{
|
||||
return PlayerState.Idle;
|
||||
// return PlayerState.Idle;
|
||||
return PlayerState.Fight;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
{
|
||||
protected override void OnEnter()
|
||||
{
|
||||
PlayerView.Unity.ModelAsset.PlayerAnimator.BaitThrown = false;
|
||||
InputManager.OnOp1Action += OnOp1Action;
|
||||
TakeLine();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user