This commit is contained in:
2026-02-21 19:51:53 +08:00
parent 27a1f9d084
commit d953ea4b7a
11 changed files with 212 additions and 79 deletions

View File

@@ -23,7 +23,80 @@ namespace NBF
protected override uint onUpdate()
{
return States.None;
var ret = States.None;
var isUpRod = false;
var isSubLine = false;
if (InputManager.IsOp1)
{
if (!Player.Data.IsLureRod)
{
//抬杆
isUpRod = true;
}
else
{
//收线
isSubLine = true;
}
}
if (InputManager.IsOp2)
{
if (Player.Data.IsLureRod)
{
//抬杆
isUpRod = true;
}
}
//Player.ModelAsset.PlayerAnimator.FishingUp = 0;
if (isUpRod || Player.ModelAsset.PlayerAnimator.FishingUp > 0)
{
var upForce = 1;
var addNum = upForce * Time.deltaTime;
if (!isUpRod)
{
addNum *= -1;
}
else
{
addNum *= 0.5f;
}
// Debug.Log($"addNum={addNum}");
Player.ModelAsset.PlayerAnimator.FishingUp += addNum;
Debug.LogError($"ishingFinal={Player.ModelAsset.PlayerAnimator.FishingUp}");
if (Player.ModelAsset.PlayerAnimator.FishingUp >= 1)
{
Player.ModelAsset.PlayerAnimator.FishingUp = 1;
}
else if (Player.ModelAsset.PlayerAnimator.FishingUp < 0)
{
Player.ModelAsset.PlayerAnimator.FishingUp = 0;
}
if (Player.ModelAsset.PlayerAnimator.FishingUp >= 0.8f)
{
ret = CheckTackFish();
}
}
else
{
Player.ModelAsset.PlayerAnimator.FishingUp = 0;
}
return ret;
}
#region
private uint CheckTackFish()
{
return (uint)PlayerState.Idle;
}
#endregion
}
}

View File

@@ -19,6 +19,7 @@ namespace NBF
protected override void OnShow()
{
InputManager.Instance.On(this);
ItemInfo = GetData() as ItemInfo;
if (ItemInfo == null || ItemInfo.Config == null)
{
@@ -35,32 +36,89 @@ namespace NBF
// var model = PrefabsHelper.CreatePrefab(ItemInfo.Config.Model);
Model.SetData(ItemInfo);
// Model.SetBackground(Back);
InputManager.OnUICanceled += OnUICanceled;
}
private void OnUICanceled(string action)
#region UI事件
//
// [InputInvoke(InputDef.UI.Prev, UIInputButtonShowMode.MenuLeft)]
// private void OnPrev()
// {
// ItemList.Menu.OnClickBtnPrev();
// }
//
// [InputInvoke(InputDef.UI.Next, UIInputButtonShowMode.MenuRight)]
// private void OnNext()
// {
// ItemList.Menu.OnClickBtnNext();
// }
//
// [InputInvoke(InputDef.UI.Left, UIInputButtonShowMode.BottomLeft)]
// private void OnLeft()
// {
// ItemList.List.Selector.Left();
// }
//
// [InputInvoke(InputDef.UI.Right, UIInputButtonShowMode.BottomLeft)]
// private void OnRight()
// {
// ItemList.List.Selector.Right();
// }
//
// [InputInvoke(InputDef.UI.Up, UIInputButtonShowMode.BottomLeft)]
// private void OnUp()
// {
// ItemList.List.Selector.Up();
// // ChangeListSelected();
// }
//
// [InputInvoke(InputDef.UI.Down, UIInputButtonShowMode.BottomLeft)]
// private void OnDown()
// {
// ItemList.List.Selector.Down();
// }
//
// [InputInvoke(InputDef.UI.Enter, UIInputButtonShowMode.BottomLeft, "查看")]
// private void OnApplySettings()
// {
// var selectedItem = ItemList.List.Selector.SelectedItem;
// if (selectedItem != null)
// {
// ItemList.List.InvokeClickItem(selectedItem);
// }
// }
[InputInvoke(InputDef.UI.Back, UIInputButtonShowMode.BottomRight)]
private void OnBack()
{
if (!IsTop) return;
if (action == InputDef.UI.SubPrev)
{
}
else if (action == InputDef.UI.SubNext)
{
}
else if (action == InputDef.UI.Up)
{
}
else if (action == InputDef.UI.Down)
{
}
Hide();
}
#endregion
// private void OnUICanceled(string action)
// {
// if (!IsTop) return;
// if (action == InputDef.UI.SubPrev)
// {
// }
// else if (action == InputDef.UI.SubNext)
// {
// }
// else if (action == InputDef.UI.Up)
// {
// }
// else if (action == InputDef.UI.Down)
// {
// }
// }
protected override void OnHide()
{
InputManager.Instance.Off(this);
Model.UnloadModel();
InputManager.OnUICanceled -= OnUICanceled;
}
}
}

View File

@@ -8,6 +8,7 @@
CommonBinder.BindAll();
FishingBinder.BindAll();
MainBinder.BindAll();
Common2Binder.BindAll();
}
}
}

View File

@@ -37,7 +37,8 @@ namespace NBF
}
else if (btn == BtnMake)
{
MakePanel.Show();
BagSlotPanel.Show();
// MakePanel.Show();
}
else if (btn == BtnMap)
{

View File

@@ -32,14 +32,14 @@ namespace NBF
{
await LoginHelper.Login(InputAccount.text);
// await Fishing.Instance.Go(RoleModel.Instance.Info.MapId);
await Fishing.Instance.Go(RoleModel.Instance.Info.MapId);
// FishingShopPanel.Show();
// BagPanel.Show();
// BagSlotPanel.Show();
SettingPanel.Show();
// SettingPanel.Show();
// HomePanel.Show();