更新节点的可移动性
This commit is contained in:
parent
670905633d
commit
a64ef3a90e
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -2,7 +2,7 @@
|
|||||||
"BuildId": "37670630",
|
"BuildId": "37670630",
|
||||||
"Modules":
|
"Modules":
|
||||||
{
|
{
|
||||||
"ProjectFish": "UnrealEditor-ProjectFish-0003.dll",
|
"ProjectFish": "UnrealEditor-ProjectFish.dll",
|
||||||
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor-0003.dll"
|
"ProjectFishEditor": "UnrealEditor-ProjectFishEditor.dll"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
@ -90,6 +90,10 @@ void UFishingMapSubSystem::MoveToNode(FGuid NodeID)
|
|||||||
//节点不在可移动的列表内,更新状态
|
//节点不在可移动的列表内,更新状态
|
||||||
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Immovable);
|
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Immovable);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Moveable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//根据节点类型 触发不同的事件
|
//根据节点类型 触发不同的事件
|
||||||
UFishingMapNode* node = GetNode(NodeID);
|
UFishingMapNode* node = GetNode(NodeID);
|
||||||
@ -117,6 +121,27 @@ void UFishingMapSubSystem::MoveToNode(FGuid NodeID)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UFishingMapSubSystem::MoveToAble(FGuid TargetNodeID)
|
||||||
|
{
|
||||||
|
UFishingMapNode* currentNode = GetNode(PlayerPosNodeID);
|
||||||
|
UFishingMapNode* targetNode = GetNode(TargetNodeID);
|
||||||
|
if (currentNode)
|
||||||
|
{
|
||||||
|
for (auto connection: AllConnections)
|
||||||
|
{
|
||||||
|
if (connection.FromNodeID == PlayerPosNodeID && connection.ToNodeID == TargetNodeID)
|
||||||
|
{
|
||||||
|
return true;;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return targetNode->NodeState == EMapNodeState::Moveable;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void UFishingMapSubSystem::GenerateNodes()
|
void UFishingMapSubSystem::GenerateNodes()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -91,6 +91,8 @@ public:
|
|||||||
|
|
||||||
UFUNCTION(BlueprintCallable, Category = "FishingMap")
|
UFUNCTION(BlueprintCallable, Category = "FishingMap")
|
||||||
void MoveToNode(FGuid NodeID);
|
void MoveToNode(FGuid NodeID);
|
||||||
|
UFUNCTION(BlueprintPure, Category = "FishingMap")
|
||||||
|
bool MoveToAble(FGuid TargetNodeID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetAllConnectedNodes(FGuid NodeID, TArray<FGuid>& ConnectedNodes);
|
void GetAllConnectedNodes(FGuid NodeID, TArray<FGuid>& ConnectedNodes);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user