调整节点状态逻辑

This commit is contained in:
997146918 2025-09-22 20:32:04 +08:00
parent b50712416a
commit b6b7f2a411
10 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@
"BuildId": "37670630",
"Modules":
{
"ProjectFish": "UnrealEditor-ProjectFish.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
"ProjectFish": "UnrealEditor-ProjectFish-0001.dll",
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0001.dll"
}
}

View File

@ -58,7 +58,7 @@ int32 UFishingMapSystem::GetNodeAtLayerIndex(FGuid NodeID) const
return -1;
}
TObjectPtr<UFishingMapNode> UFishingMapSystem::GetNode(FGuid NodeID)
UFishingMapNode* UFishingMapSystem::GetNode(FGuid NodeID)
{
for (auto node: AllNodes)
{
@ -84,7 +84,7 @@ void UFishingMapSystem::MoveToNode(FGuid NodeID)
if (MoveableNodeIDs.Find(node->NodeID) == -1)
{
//节点不在可移动的列表内,更新状态
OnNodeStateChange.Broadcast(EMapNodeState::Immovable);
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Immovable);
}
}
}

View File

@ -5,7 +5,7 @@
#include "ProjectFish/Definations.h"
#include "FishingMapSystem.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnNodeStateChange, EMapNodeState, NewState);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnNodeStateChange, FGuid, NodeID, EMapNodeState, NewState);
// 简化的地图节点
UCLASS(BlueprintType)
@ -80,7 +80,8 @@ public:
UFUNCTION(BlueprintPure, Category = "FishingMap")
int32 GetNodeAtLayerIndex(FGuid NodeID) const;
TObjectPtr<UFishingMapNode> GetNode(FGuid NodeID) ;
UFUNCTION(BlueprintPure, Category = "FishingMap")
class UFishingMapNode* GetNode(FGuid NodeID) ;
// 清空地图
UFUNCTION(BlueprintCallable, Category = "FishingMap")