This commit is contained in:
Bob.Song
2026-03-10 16:03:38 +08:00
parent 228de2445d
commit cf2e374998
86 changed files with 478 additions and 383 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8a7d330458276bb4ca48095942cc62da
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c67e0c4e3e30462d88970a3c0b4569e8
timeCreated: 1773123725

View File

@@ -0,0 +1,33 @@
using System.Collections.Generic;
using Fantasy;
using Fantasy.Entitas;
using NBF.Utils;
namespace NBF
{
/// <summary>
/// 玩家物品
/// </summary>
public abstract class PlayerItem : Entity
{
public Player Owner;
/// <summary>
/// 配置id
/// </summary>
public int ConfigID;
public virtual void Init(Player player, ItemInfo bindInfo)
{
Owner = player;
ConfigID = bindInfo.ConfigId;
// var itemType = bindInfo.Item.GetItemType();
// if (itemType == ItemType.Rod)
// {
// var rod = AddComponent<PlayerItemRod>();
// rod.Init(bindInfo);
// }
}
}
}

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
using Fantasy;
using Fantasy.Entitas;
namespace NBF
{
public class PlayerItemRod : PlayerItem
{
public override void Init(Player player, ItemInfo bindInfo)
{
//var binds = RoleModel.Instance.GetBindItems(item.Id);
base.Init(player, bindInfo);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9e0846296bef4505868010bfe1eee1e3
timeCreated: 1773124278

View File

@@ -2,17 +2,24 @@
using System.Collections.Generic;
using Fantasy;
using Fantasy.Entitas;
using NBF.Utils;
using UnityEngine;
namespace NBF
{
public class Player : Entity
{
// ========== 本地状态 ==========
/// <summary>
/// 是否本地玩家
/// </summary>
public bool IsLocalPlayer;
/// <summary>
/// 是否切换物品中
/// </summary>
public bool IsChangeItemIng;
public bool IsLureRod => false;
public bool IsSelf => RoleModel.Instance.Id == Id;
@@ -61,18 +68,18 @@ namespace NBF
/// <summary>
/// 当前手持物品
/// </summary>
public PlayerItem HandItem => Items[HandItemId];
public PlayerItem HandItem => Items.GetValueOrDefault(HandItemId);
#region
public void InitPlayer(MapUnitInfo unitInfo)
{
AddComponent<PlayerViewComponent>();
AddComponent<PlayerStateViewComponent>();
AddComponent<PlayerView>();
AddComponent<PlayerStateView>();
if (unitInfo.Id == RoleModel.Instance.Id)
{
//自己
AddComponent<PlayerInputComponent>();
AddComponent<PlayerInput>();
}
}
@@ -80,29 +87,44 @@ namespace NBF
#region
public void UnUseItem()
public void ReleaseItem(PlayerItem item)
{
if (Items.TryGetValue(HandItemId, out var item))
if (Items.ContainsValue(item))
{
Items.Remove(item.Id);
item.Dispose();
}
}
public void UnUseItem()
{
var prevItem = HandItem;
HandItemId = 0;
ItemChangeEvent();
ItemChangeEvent(prevItem);
}
public void UseItem(ItemBindInfo item)
public void UseItem(ItemInfo item)
{
var playerItem = Create<PlayerItem>(Scene);
playerItem.Init(item);
ItemChangeEvent();
}
private void ItemChangeEvent()
{
Scene.EventComponent.Publish(new PlayerStateChangeEvent
var prevItem = HandItem;
var itemType = item.ConfigId.GetItemType();
if (itemType == ItemType.Rod)
{
Player = this
var playerItemRod = Create<PlayerItemRod>(Scene);
playerItemRod.Init(this, item);
Items[playerItemRod.Id] = playerItemRod;
HandItemId = playerItemRod.Id;
}
ItemChangeEvent(prevItem);
}
private void ItemChangeEvent(PlayerItem prevItem)
{
Scene.EventComponent.Publish(new PlayerItemChangeEvent
{
Player = this,
Item = HandItem,
PrevItem = prevItem
});
}

View File

@@ -1,25 +0,0 @@
using System.Collections.Generic;
using Fantasy;
using Fantasy.Entitas;
namespace NBF
{
public class PlayerItem : Entity
{
/// <summary>
/// 配置id
/// </summary>
public int ConfigID;
/// <summary>
/// 绑定的子物体
/// </summary>
public List<int> BindItems = new List<int>();
public void Init(ItemBindInfo bindInfo)
{
ConfigID = bindInfo.Item;
BindItems.AddRange(bindInfo.BindItems);
}
}
}

View File

@@ -1,3 +1,3 @@
fileFormatVersion: 2
guid: 172aa8a5a1444ccbad1647479739c232
timeCreated: 1773060255
guid: a348fcaa64274862baa542a3dc1ffc62
timeCreated: 1773117606

View File

@@ -1,12 +1,15 @@
namespace NBF
namespace NBF
{
public struct PlayerStateChangeEvent
{
public Player Player;
}
public struct PlayerItemChangeEvent
public struct PlayerItemChangeEvent
{
public Player Player;
public PlayerItem Item;
public PlayerItem PrevItem;
}
}
}

View File

@@ -1,13 +0,0 @@
using Fantasy.Event;
namespace NBF.Handle
{
public class OnPlayerStateChangeEvent : EventSystem<PlayerStateChangeEvent>
{
protected override void Handler(PlayerStateChangeEvent self)
{
var view = self.Player.GetOrAddComponent<PlayerItemViewComponent>();
view.ShowItem();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b7a71b6539c547fcaab2b89279530aef
timeCreated: 1773116602

View File

@@ -0,0 +1,13 @@
using Fantasy.Event;
namespace NBF.Handle
{
public class OnPlayerStateChangeEvent : EventSystem<PlayerItemChangeEvent>
{
protected override void Handler(PlayerItemChangeEvent self)
{
var view = self.Player.GetOrAddComponent<PlayerView>();
view.ChangeItem(self).Coroutine();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f9c361f2958454abb43724693a2157a
timeCreated: 1773116527

View File

@@ -0,0 +1,20 @@
using Fantasy.Async;
using UnityEngine;
namespace NBF
{
public class PlayerItemRodView : PlayerItemView
{
public RodAsset RodAsset;
public override async FTask InitShow(PlayerItem item)
{
Item = item;
var itemConfig = Game.Tables.TbItem.Get(Item.ConfigID);
RodAsset = itemConfig.InstantiateAndComponent<RodAsset>(SceneSettings.Instance.GearNode, Vector3.zero,
Quaternion.identity);
// await Rod.InitRod(Item);
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 77390e0ed53847f3b190ffc0d9f1319a
timeCreated: 1773124629

View File

@@ -0,0 +1,27 @@
using Fantasy.Async;
using Fantasy.Entitas;
using UnityEngine;
namespace NBF
{
/// <summary>
/// 玩家物品视图组件
/// </summary>
public abstract class PlayerItemView : Entity
{
public PlayerItem Item { get; protected set; }
public abstract FTask InitShow(PlayerItem item);
// public async FTask InitShow()
// {
// // Item = GetParent<PlayerItem>();
// var itemConfig = Game.Tables.TbItem.Get(Item.ConfigID);
// // Rod = itemConfig.InstantiateAndComponent<FRod>(SceneSettings.Instance.GearNode, Vector3.zero,
// // Quaternion.identity);
//
// // await Rod.InitRod(Item);
// }
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 98838cf2cf934b8aaaf97f4d58544055
timeCreated: 1773116536

View File

@@ -1,6 +1,7 @@
using System;
using KINEMATION.MagicBlend.Runtime;
using NBC;
using NBF.Utils;
using UnityEngine;
namespace NBF
@@ -83,35 +84,23 @@ namespace NBF
_Animator.keepAnimatorStateOnDisable = true;
_IK = GetComponent<PlayerIK>();
_isInit = true;
// Player.OnFishingSetEquiped += OnFishingSetEquiped_OnRaised;
// Player.OnFishingSetUnequip += OnFishingSetUnequip;
}
private void OnDestroy()
{
// Player.OnFishingSetEquiped -= OnFishingSetEquiped_OnRaised;
// Player.OnFishingSetUnequip -= OnFishingSetUnequip;
}
private void OnFishingSetUnequip()
public void OnUnUseItem()
{
_isRodLayerEnabled = false;
}
private void OnFishingSetEquiped_OnRaised(FHandItem item)
public void OnUseItem(PlayerItemView item)
{
if (item is FRod rod)
var itemType = item.Item.ConfigID.GetItemType();
if (itemType == ItemType.Rod)
{
_isRodLayerEnabled = true;
// var reel = Player.Rod.Reel;
// _IK.SetBipedLeftHandIK(enabled: false, reel.FingersIKAnchor);
}
else
{
}
}

View File

@@ -7,34 +7,34 @@ using Log = NBC.Log;
namespace NBF
{
public class PlayerInputComponent : Entity
public class PlayerInput : Entity
{
public Player Player { get; private set; }
public PlayerViewComponent View { get; private set; }
public PlayerView View { get; private set; }
#region
public class PlayerViewAwakeSystem : AwakeSystem<PlayerInputComponent>
public class PlayerViewAwakeSystem : AwakeSystem<PlayerInput>
{
protected override void Awake(PlayerInputComponent self)
protected override void Awake(PlayerInput self)
{
self.Player = self.GetParent<Player>();
self.View = self.Player.GetComponent<PlayerViewComponent>();
self.View = self.Player.GetComponent<PlayerView>();
self.AddInputEvent();
}
}
public class PlayerViewUpdateSystem : UpdateSystem<PlayerInputComponent>
public class PlayerViewUpdateSystem : UpdateSystem<PlayerInput>
{
protected override void Update(PlayerInputComponent self)
protected override void Update(PlayerInput self)
{
self.UpdateMove();
}
}
public class PlayerViewDestroySystem : DestroySystem<PlayerInputComponent>
public class PlayerViewDestroySystem : DestroySystem<PlayerInput>
{
protected override void Destroy(PlayerInputComponent self)
protected override void Destroy(PlayerInput self)
{
self.RemoveInputEvent();
}
@@ -90,15 +90,7 @@ namespace NBF
var item = RoleModel.Instance.GetSlotItem(index - 1);
if (item != null)
{
var itemBindInfo = ItemBindInfo.Create();
itemBindInfo.Item = item.ConfigId;
var binds = RoleModel.Instance.GetBindItems(item.Id);
foreach (var itemInfo in binds)
{
itemBindInfo.BindItems.Add(itemInfo.ConfigId);
}
Player.UseItem(itemBindInfo);
Player.UseItem(item);
}
}
}

View File

@@ -8,7 +8,7 @@ namespace NBF
/// <summary>
/// 状态显示层组件
/// </summary>
public class PlayerStateViewComponent : Entity
public class PlayerStateView : Entity
{
private readonly Dictionary<PlayerState, PlayerStageViewBase> _stageViews =
new Dictionary<PlayerState, PlayerStageViewBase>();
@@ -47,17 +47,17 @@ namespace NBF
}
}
public class PlayerStateViewComponentAwakeSystem : AwakeSystem<PlayerStateViewComponent>
public class PlayerStateViewComponentAwakeSystem : AwakeSystem<PlayerStateView>
{
protected override void Awake(PlayerStateViewComponent self)
protected override void Awake(PlayerStateView self)
{
self.Awake();
}
}
public class PlayerStateViewComponentUpdateSystem : UpdateSystem<PlayerStateViewComponent>
public class PlayerStateViewComponentUpdateSystem : UpdateSystem<PlayerStateView>
{
protected override void Update(PlayerStateViewComponent self)
protected override void Update(PlayerStateView self)
{
self.Update();
}
@@ -67,7 +67,7 @@ namespace NBF
{
protected override void Handler(PlayerStateChangeEvent self)
{
var stateView = self.Player.GetComponent<PlayerStateViewComponent>();
var stateView = self.Player.GetComponent<PlayerStateView>();
if (stateView != null)
{
stateView.OnStageChange();

View File

@@ -0,0 +1,150 @@
using Fantasy.Async;
using Fantasy.Entitas;
using Fantasy.Entitas.Interface;
using NBF.Fishing2;
using NBF.Utils;
using UnityEngine;
namespace NBF
{
public class PlayerView : Entity
{
public Player Player { get; private set; }
public PlayerUnityComponent Unity { get; private set; }
#region
public void Awake()
{
Player = GetParent<Player>();
var gameObject = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
Unity = gameObject.GetComponent<PlayerUnityComponent>();
Unity.Player = Player;
CreatePlayerModel();
if (Player.IsSelf)
{
CameraManager.Instance.SetFppLook(Unity);
}
Unity.transform.localPosition = new Vector3(484, 1, 422);
}
public void Update()
{
}
public void LateUpdate()
{
Player.EyeAngle = GameUtils.GetVerticalAngle(Unity.transform, Unity.FppLook);
}
public void Destroy()
{
}
#endregion
#region
private void CreatePlayerModel()
{
var modelObject = PrefabsHelper.CreatePlayer(Unity.Root, "Human_Male");
modelObject.transform.localPosition = new Vector3(0, 1, 0);
Unity.ModelAsset = modelObject.GetComponent<PlayerModelAsset>();
Unity.ModelAsset.SetPlayer(Unity.FppLook);
}
#endregion
#region
public async FTask ChangeItem(PlayerItemChangeEvent playerStateChangeEvent)
{
var prevItem = playerStateChangeEvent.PrevItem;
var currItem = playerStateChangeEvent.Item;
if (Player.IsChangeItemIng) return;
Player.IsChangeItemIng = true;
if (currItem == null)
{
//收起物品
await UnUseItem(prevItem);
}
else
{
// 先收起旧的物品
await UnUseItemConfirm(prevItem);
var handItem = Player.HandItem;
//拿起新物品
var itemType = handItem.ConfigID.GetItemType();
if (itemType == ItemType.Rod)
{
var itemView = handItem.GetOrAddComponent<PlayerItemRodView>();
await itemView.InitShow(handItem);
Unity.ModelAsset.PlayerAnimator.OnUseItem(itemView);
}
}
Player.IsChangeItemIng = false;
}
#region 使
public async FTask UnUseItem(PlayerItem item)
{
if (item == null) return;
if (Player.IsChangeItemIng) return;
Player.IsChangeItemIng = true;
await UnUseItemConfirm(item);
Player.IsChangeItemIng = false;
}
private async FTask UnUseItemConfirm(PlayerItem item)
{
if (item != null)
{
Unity.ModelAsset.PlayerAnimator.OnUnUseItem();
await FTask.Wait(Scene, 100);
}
Player.ReleaseItem(item);
await FTask.Wait(Scene, 450);
}
#endregion
#endregion
}
public class PlayerViewAwakeSystem : AwakeSystem<PlayerView>
{
protected override void Awake(PlayerView self)
{
self.Awake();
}
}
public class PlayerViewDestroySystem : DestroySystem<PlayerView>
{
protected override void Destroy(PlayerView self)
{
self.Destroy();
}
}
public class PlayerViewUpdateSystem : UpdateSystem<PlayerView>
{
protected override void Update(PlayerView self)
{
self.Update();
}
}
public class PlayerViewLateUpdateSystem : LateUpdateSystem<PlayerView>
{
protected override void LateUpdate(PlayerView self)
{
self.LateUpdate();
}
}
}

View File

@@ -5,7 +5,7 @@ namespace NBF
public abstract class PlayerStageViewBase
{
public Player Player { get; private set; }
public PlayerViewComponent PlayerView { get; private set; }
public PlayerView PlayerView { get; private set; }
protected float EnterTime { get; set; }
protected PlayerState PreviousState { get; private set; }
@@ -14,7 +14,7 @@ namespace NBF
public void Init(Player player)
{
Player = player;
PlayerView = player.GetComponent<PlayerViewComponent>();
PlayerView = player.GetComponent<PlayerView>();
}
/// <summary>

View File

@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using Fantasy;
using Fantasy.Async;
using NBC.Asset;
using NBF.Utils;
using UnityEngine;
@@ -13,6 +14,7 @@ namespace NBF
{
private float _tension;
/// <summary>
/// 可用的
/// </summary>
@@ -122,125 +124,125 @@ namespace NBF
yield return 1;
}
public IEnumerator InitRod(Player player, ItemBindInfo itemBindInfo)
public async FTask InitRod(PlayerItem playerItem)
{
ConfigId = itemBindInfo.Item;
// Player = player;
var playerView = player.GetComponent<PlayerViewComponent>();
var playerViewUnity = playerView.Unity;
transform.localPosition = Vector3.zero;
transform.localRotation = Quaternion.identity;
transform.localScale = Vector3.one;
SceneSettings.Instance.GearNode.position = playerViewUnity.transform.position;
yield return 1;
var obj = new GameObject($"rod_{ConfigId}");
obj.transform.SetParent(SceneSettings.Instance.GearNode);
// obj.transform.SetParent(player.transform);
// obj.transform.localPosition = Vector3.zero;
obj.transform.position = playerViewUnity.transform.position;
obj.transform.rotation = playerViewUnity.transform.rotation;
obj.transform.localScale = Vector3.one;
GearRoot = obj.transform;
var parent = GearRoot;
// List<ItemInfo> children = RoleModel.Instance.GetBindItems(itemInfo.Id);
CreateFishingHandler();
yield return 1; //等待1帧
// children.Sort();
foreach (var childConfigId in itemBindInfo.BindItems)
{
var itemType = childConfigId.GetItemType();
var config = Game.Tables.TbItem.Get(childConfigId);
if (itemType == ItemType.Reel)
{
Reel = config.InstantiateAndComponent<FReel>(Asset.ReelConnector, Vector3.zero,
Quaternion.identity);
Reel.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Bobber)
{
Bobber = config.InstantiateAndComponent<FBobber>(parent, Vector3.zero,
Quaternion.identity);
Bobber.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Hook)
{
Hook = config.InstantiateAndComponent<FHook>(parent, Vector3.zero,
Quaternion.identity);
Hook.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Bait)
{
Bait = config.InstantiateAndComponent<FBait>(parent, Vector3.zero,
Quaternion.identity);
Bait.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Lure)
{
Lure = config.InstantiateAndComponent<FLure>(parent, Vector3.zero,
Quaternion.identity);
Lure.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Weight)
{
Weight = config.InstantiateAndComponent<FWeight>(parent, Vector3.zero,
Quaternion.identity);
Weight.SetItemConfigId(childConfigId);
}
else if (itemType == ItemType.Line)
{
// lineItemInfo = child;
}
}
yield return 1;
if (Reel)
{
Reel.reelingDrag = 0.699f;
Reel.transform.SetParent(Asset.ReelConnector);
Reel.transform.localPosition = Vector3.zero;
Reel.transform.localEulerAngles = Vector3.zero;
Reel.Init(this);
}
if (Bobber)
{
Bobber.Init(this);
}
if (Hook)
{
Hook.Init(this);
}
if (Bait)
{
Bait.Init(this);
}
if (Lure)
{
Lure.Init(this);
}
if (Weight)
{
Weight.Init(this);
}
yield return 1; //等待1帧
transform.SetParent(playerViewUnity.ModelAsset.RodRoot);
transform.localPosition = Vector3.zero;
transform.rotation = playerViewUnity.ModelAsset.RodRoot.rotation;
Usable = true;
// ConfigId = itemBindInfo.Item;
// // Player = player;
//
// var playerView = player.GetComponent<PlayerView>();
//
// var playerViewUnity = playerView.Unity;
//
// transform.localPosition = Vector3.zero;
// transform.localRotation = Quaternion.identity;
// transform.localScale = Vector3.one;
// SceneSettings.Instance.GearNode.position = playerViewUnity.transform.position;
// yield return 1;
// var obj = new GameObject($"rod_{ConfigId}");
// obj.transform.SetParent(SceneSettings.Instance.GearNode);
// // obj.transform.SetParent(player.transform);
// // obj.transform.localPosition = Vector3.zero;
// obj.transform.position = playerViewUnity.transform.position;
// obj.transform.rotation = playerViewUnity.transform.rotation;
// obj.transform.localScale = Vector3.one;
// GearRoot = obj.transform;
//
// var parent = GearRoot;
//
// // List<ItemInfo> children = RoleModel.Instance.GetBindItems(itemInfo.Id);
//
//
// CreateFishingHandler();
// yield return 1; //等待1帧
// // children.Sort();
// foreach (var childConfigId in itemBindInfo.BindItems)
// {
// var itemType = childConfigId.GetItemType();
// var config = Game.Tables.TbItem.Get(childConfigId);
// if (itemType == ItemType.Reel)
// {
// Reel = config.InstantiateAndComponent<FReel>(Asset.ReelConnector, Vector3.zero,
// Quaternion.identity);
// Reel.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Bobber)
// {
// Bobber = config.InstantiateAndComponent<FBobber>(parent, Vector3.zero,
// Quaternion.identity);
// Bobber.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Hook)
// {
// Hook = config.InstantiateAndComponent<FHook>(parent, Vector3.zero,
// Quaternion.identity);
// Hook.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Bait)
// {
// Bait = config.InstantiateAndComponent<FBait>(parent, Vector3.zero,
// Quaternion.identity);
// Bait.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Lure)
// {
// Lure = config.InstantiateAndComponent<FLure>(parent, Vector3.zero,
// Quaternion.identity);
// Lure.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Weight)
// {
// Weight = config.InstantiateAndComponent<FWeight>(parent, Vector3.zero,
// Quaternion.identity);
// Weight.SetItemConfigId(childConfigId);
// }
// else if (itemType == ItemType.Line)
// {
// // lineItemInfo = child;
// }
// }
//
// yield return 1;
// if (Reel)
// {
// Reel.reelingDrag = 0.699f;
// Reel.transform.SetParent(Asset.ReelConnector);
// Reel.transform.localPosition = Vector3.zero;
// Reel.transform.localEulerAngles = Vector3.zero;
// Reel.Init(this);
// }
//
// if (Bobber)
// {
// Bobber.Init(this);
// }
//
// if (Hook)
// {
// Hook.Init(this);
// }
//
// if (Bait)
// {
// Bait.Init(this);
// }
//
// if (Lure)
// {
// Lure.Init(this);
// }
//
// if (Weight)
// {
// Weight.Init(this);
// }
//
// yield return 1; //等待1帧
//
// transform.SetParent(playerViewUnity.ModelAsset.RodRoot);
// transform.localPosition = Vector3.zero;
// transform.rotation = playerViewUnity.ModelAsset.RodRoot.rotation;
//
// Usable = true;
}

View File

@@ -1,67 +0,0 @@
using System.Collections;
using Fantasy.Entitas;
namespace NBF
{
public class PlayerItemViewComponent : Entity
{
public void ShowItem()
{
// Game.Instance.StartCoroutine()
}
#region 使
// public IEnumerator UseItem(ItemInfo item)
// {
// if (Data.ChangeItem) yield break;
// Data.ChangeItem = true;
// var itemType = item?.ConfigId.GetItemType();
// if (itemType == ItemType.Rod)
// {
// //判断旧的是否要收回
// yield return UnUseItemConfirm();
//
// Data.IsLureRod = true;
// var rodType = (ItemSubType)item.Config.Type;
// if (rodType == ItemSubType.RodTele)
// {
// Data.IsLureRod = false;
// }
//
// Rod =
// item.Config.InstantiateAndComponent<FRod>(SceneSettings.Instance.GearNode, Vector3.zero,
// Quaternion.identity);
// yield return Rod.InitRod(this, item);
// Tackles.Add(Rod);
// OnFishingSetEquiped?.Invoke(Rod);
// }
//
// Data.ChangeItem = false;
// }
//
// public IEnumerator UnUseItem()
// {
// if (Data.ChangeItem) yield break;
// Data.ChangeItem = true;
// yield return UnUseItemConfirm();
// Data.ChangeItem = false;
// }
//
// private IEnumerator UnUseItemConfirm()
// {
// if (Rod != null)
// {
// OnFishingSetUnequip?.Invoke();
// yield return Rod.Destroy();
// yield return new WaitForSeconds(0.35f);
// Destroy(Rod.gameObject);
// Tackles.Remove(Rod);
// Rod = null;
// yield return new WaitForSeconds(0.15f);
// }
// }
#endregion
}
}

View File

@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: cf5f405feb8f431ea52d8f33b3cb2e29
timeCreated: 1773069665

View File

@@ -1,90 +0,0 @@
using Fantasy.Entitas;
using Fantasy.Entitas.Interface;
using NBF.Fishing2;
using UnityEngine;
namespace NBF
{
public class PlayerViewComponent : Entity
{
public Player Player { get; private set; }
public PlayerUnityComponent Unity { get; private set; }
#region
public void Awake()
{
Player = GetParent<Player>();
var gameObject = PrefabsHelper.CreatePlayer(SceneSettings.Instance.Node);
Unity = gameObject.GetComponent<PlayerUnityComponent>();
Unity.Player = Player;
CreatePlayerModel();
if (Player.IsSelf)
{
CameraManager.Instance.SetFppLook(Unity);
}
Unity.transform.localPosition = new Vector3(484, 1, 422);
}
public void Update()
{
}
public void LateUpdate()
{
Player.EyeAngle = GameUtils.GetVerticalAngle(Unity.transform, Unity.FppLook);
}
public void Destroy()
{
}
#endregion
#region
private void CreatePlayerModel()
{
var modelObject = PrefabsHelper.CreatePlayer(Unity.Root, "Human_Male");
modelObject.transform.localPosition = new Vector3(0, 1, 0);
Unity.ModelAsset = modelObject.GetComponent<PlayerModelAsset>();
Unity.ModelAsset.SetPlayer(Unity.FppLook);
}
#endregion
}
public class PlayerViewAwakeSystem : AwakeSystem<PlayerViewComponent>
{
protected override void Awake(PlayerViewComponent self)
{
self.Awake();
}
}
public class PlayerViewDestroySystem : DestroySystem<PlayerViewComponent>
{
protected override void Destroy(PlayerViewComponent self)
{
self.Destroy();
}
}
public class PlayerViewUpdateSystem : UpdateSystem<PlayerViewComponent>
{
protected override void Update(PlayerViewComponent self)
{
self.Update();
}
}
public class PlayerViewLateUpdateSystem : LateUpdateSystem<PlayerViewComponent>
{
protected override void LateUpdate(PlayerViewComponent self)
{
self.LateUpdate();
}
}
}

View File

@@ -4922,9 +4922,9 @@ namespace Fantasy
MessageObjectPool<ItemBindInfo>.Return(this);
}
[ProtoMember(1)]
public int Item { get; set; }
public long Item { get; set; }
[ProtoMember(2)]
public List<int> BindItems { get; set; } = new List<int>();
public List<long> BindItems { get; set; } = new List<long>();
}
/// <summary>
/// 物品信息

View File

@@ -34,6 +34,7 @@
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIMGUIContainer_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb4f75f0eb2d14004826911645c6175d61fbe00_003F49_003F22dd7281_003FIMGUIContainer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIMGUIContainer_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F348ed09ed1634d388253e20b5aab3fcf223400_003Ff5_003F8f871742_003FIMGUIContainer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AIMGUIContainer_002Ecs_002Fl_003AC_0021_003FUsers_003F60527_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F348ed09ed1634d388253e20b5aab3fcf223400_003Ff5_003F8f871742_003FIMGUIContainer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AInt32_002Ecs_002Fl_003AC_0021_003FUsers_003FFIREBAT_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fee16c2cb688d4766af955c0ec92acd90573638_003Fa4_003Fca01585e_003FInt32_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializerInternalWriter_002Ecs_002Fl_003AC_0021_003FUsers_003FFIREBAT_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FSourcesCache_003Fe2e3d26278e439d44964729238a685ad58d3189abf8fb84cdfe34b893a290a2_003FJsonSerializerInternalWriter_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonSerializer_002Ecs_002Fl_003AC_0021_003FUsers_003FFIREBAT_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F761cf2a144514d2291a678c334d49e9baa000_003F17_003F2f6d958d_003FJsonSerializer_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AJsonUtility_002Ecs_002Fl_003AC_0021_003FUsers_003FFIREBAT_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fbd535c51a50047bd8847b8df6bc5f2a44600_003F57_003F2ada4d31_003FJsonUtility_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 12 KiB