diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll index 75f8708..b5ad910 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFish.dll differ diff --git a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll index aa4aa58..9f50551 100644 Binary files a/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll and b/ProjectFish/Binaries/Win64/UnrealEditor-ProjectFishEditor.dll differ diff --git a/ProjectFish/Config/DefaultEngine.ini b/ProjectFish/Config/DefaultEngine.ini index 6e3834b..9c21609 100644 --- a/ProjectFish/Config/DefaultEngine.ini +++ b/ProjectFish/Config/DefaultEngine.ini @@ -96,7 +96,8 @@ ManualIPAddress= +ClassRedirects=(OldName="/Script/ProjectFish.Skill_Pull",NewName="/Script/ProjectFish.SkillEffect_Damage") +ClassRedirects=(OldName="/Script/ProjectFish.SkillEffect_Pull",NewName="/Script/ProjectFish.SkillEffect_Damage") +ClassRedirects=(OldName="/Script/ProjectFish.PlayerInventorySubsystem",NewName="/Script/ProjectFish.FishingRodConfigSubsystem") -+ClassRedirects=(OldName="/Script/ProjectFish.SimpleMapSystem",NewName="/Script/ProjectFish.FishingMapSystem") ++ClassRedirects=(OldName="/Script/ProjectFish.SimpleMapSystem",NewName="/Script/ProjectFish.FishingMapSubSystem") ++ClassRedirects=(OldName="/Script/ProjectFish.FishingMapSystem",NewName="/Script/ProjectFish.FishingMapSubSystem") [/Script/Engine.CollisionProfile] -Profiles=(Name="NoCollision",CollisionEnabled=NoCollision,ObjectTypeName="WorldStatic",CustomResponses=((Channel="Visibility",Response=ECR_Ignore),(Channel="Camera",Response=ECR_Ignore)),HelpMessage="No collision",bCanModify=False) diff --git a/ProjectFish/Content/Gameplay/Characters/MapScene/BP_MapDemoCharacter.uasset b/ProjectFish/Content/Gameplay/Characters/MapScene/BP_MapDemoCharacter.uasset index a973e7a..11bc2bf 100644 Binary files a/ProjectFish/Content/Gameplay/Characters/MapScene/BP_MapDemoCharacter.uasset and b/ProjectFish/Content/Gameplay/Characters/MapScene/BP_MapDemoCharacter.uasset differ diff --git a/ProjectFish/Content/Gameplay/MapSystem/BP_MapNode.uasset b/ProjectFish/Content/Gameplay/MapSystem/BP_MapNode.uasset index 9af3b5c..35782c6 100644 Binary files a/ProjectFish/Content/Gameplay/MapSystem/BP_MapNode.uasset and b/ProjectFish/Content/Gameplay/MapSystem/BP_MapNode.uasset differ diff --git a/ProjectFish/Content/Maps/MaySystem.umap b/ProjectFish/Content/Maps/MaySystem.umap index 7702dc8..fcf8bfe 100644 Binary files a/ProjectFish/Content/Maps/MaySystem.umap and b/ProjectFish/Content/Maps/MaySystem.umap differ diff --git a/ProjectFish/Source/ProjectFish/Components/FishingRodComponent.cpp b/ProjectFish/Source/ProjectFish/Components/FishingRodComponent.cpp index 2aa5475..dc2eeac 100644 --- a/ProjectFish/Source/ProjectFish/Components/FishingRodComponent.cpp +++ b/ProjectFish/Source/ProjectFish/Components/FishingRodComponent.cpp @@ -7,7 +7,7 @@ #include "ProjectFish/Definations.h" #include "ProjectFish/PawnWithSkill.h" #include "ProjectFish/DataAsset/BagConfigAsset.h" -#include "ProjectFish/Subsystem/FishingRodConfigSubsystem.h" +#include "ProjectFish/Gameplay/Subsystem/FishingRodConfigSubsystem.h" // Sets default values for this component's properties diff --git a/ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.cpp b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp similarity index 91% rename from ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.cpp rename to ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp index 0251882..e853991 100644 --- a/ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.cpp +++ b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.cpp @@ -1,4 +1,4 @@ -#include "FishingMapSystem.h" +#include "FishingMapSubSystem.h" #include "Engine/Engine.h" #include "Kismet/GameplayStatics.h" #include "ProjectFish/DataAsset/MapConfigAsset.h" @@ -18,17 +18,17 @@ void UFishingMapNode::RandomNodeType() NodeType = static_cast(FMath::RandRange(0, 1)); } -UFishingMapSystem::UFishingMapSystem() +UFishingMapSubSystem::UFishingMapSubSystem() { } -void UFishingMapSystem::GenerateMap() +void UFishingMapSubSystem::GenerateMap() { GenerateMapWithConfig(MapConfig); } -void UFishingMapSystem::GenerateMapWithConfig(const UMapConfigAsset* Config) +void UFishingMapSubSystem::GenerateMapWithConfig(const UMapConfigAsset* Config) { // 清空现有数据 ClearMap(); @@ -46,7 +46,7 @@ void UFishingMapSystem::GenerateMapWithConfig(const UMapConfigAsset* Config) GetLayerCount(), AllNodes.Num(), AllConnections.Num()); } -int32 UFishingMapSystem::GetNodeAtLayerIndex(FGuid NodeID) const +int32 UFishingMapSubSystem::GetNodeAtLayerIndex(FGuid NodeID) const { for (FMapLayer Layer: AllLayers) { @@ -59,7 +59,7 @@ int32 UFishingMapSystem::GetNodeAtLayerIndex(FGuid NodeID) const return -1; } -UFishingMapNode* UFishingMapSystem::GetNode(FGuid NodeID) +UFishingMapNode* UFishingMapSubSystem::GetNode(FGuid NodeID) { for (auto node: AllNodes) { @@ -69,15 +69,16 @@ UFishingMapNode* UFishingMapSystem::GetNode(FGuid NodeID) return nullptr; } -void UFishingMapSystem::ClearMap() +void UFishingMapSubSystem::ClearMap() { AllNodes.Empty(); AllConnections.Empty(); AllLayers.Empty(); } -void UFishingMapSystem::MoveToNode(FGuid NodeID) +void UFishingMapSubSystem::MoveToNode(FGuid NodeID) { + PlayerPosNodeID = NodeID; TArray MoveableNodeIDs; GetAllConnectedNodes(NodeID, MoveableNodeIDs); for (auto node:AllNodes) @@ -104,7 +105,7 @@ void UFishingMapSystem::MoveToNode(FGuid NodeID) } -void UFishingMapSystem::GenerateNodes() +void UFishingMapSubSystem::GenerateNodes() { AllLayers.SetNum(MapConfig->TotalLayers); UE_LOG(LogTemp, Warning, TEXT("生成layer层数: %d "), MapConfig->TotalLayers ); @@ -142,7 +143,7 @@ void UFishingMapSystem::GenerateNodes() } } -void UFishingMapSystem::CalculateNodePositions() +void UFishingMapSubSystem::CalculateNodePositions() { for (int32 LayerIndex = 0; LayerIndex < AllLayers.Num(); ++LayerIndex) { @@ -162,7 +163,7 @@ void UFishingMapSystem::CalculateNodePositions() } } -void UFishingMapSystem::GenerateConnections() +void UFishingMapSubSystem::GenerateConnections() { AllConnections.Empty(); @@ -188,7 +189,7 @@ void UFishingMapSystem::GenerateConnections() } } -TArray UFishingMapSystem::GenerateNonCrossingConnections(int32 FromLayer, int32 ToLayer) +TArray UFishingMapSubSystem::GenerateNonCrossingConnections(int32 FromLayer, int32 ToLayer) { TArray Connections; @@ -258,7 +259,7 @@ TArray UFishingMapSystem::GenerateNonCrossingConnections(int3 return Connections; } -void UFishingMapSystem::GetAllConnectedNodes(FGuid NodeID, TArray& ConnectedNodes) +void UFishingMapSubSystem::GetAllConnectedNodes(FGuid NodeID, TArray& ConnectedNodes) { //获取所有可移动的节点 ConnectedNodes.Add(NodeID); diff --git a/ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.h b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.h similarity index 93% rename from ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.h rename to ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.h index a2f1be0..8993059 100644 --- a/ProjectFish/Source/ProjectFish/Gameplay/MapSystem/FishingMapSystem.h +++ b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingMapSubSystem.h @@ -3,7 +3,7 @@ #include "CoreMinimal.h" #include "Engine/DataAsset.h" #include "ProjectFish/Definations.h" -#include "FishingMapSystem.generated.h" +#include "FishingMapSubSystem.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnNodeStateChange, FGuid, NodeID, EMapNodeState, NewState); @@ -45,12 +45,12 @@ public: * 简化的地图生成系统 */ UCLASS(BlueprintType) -class PROJECTFISH_API UFishingMapSystem : public UObject +class PROJECTFISH_API UFishingMapSubSystem : public UGameInstanceSubsystem { GENERATED_BODY() public: - UFishingMapSystem(); + UFishingMapSubSystem(); UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (ToolTip = "地图配置")) class UMapConfigAsset* MapConfig; @@ -67,6 +67,8 @@ public: UPROPERTY(BlueprintAssignable) FOnNodeStateChange OnNodeStateChange; + UPROPERTY(BlueprintReadWrite) + FGuid PlayerPosNodeID; // 生成地图 UFUNCTION(BlueprintCallable, Category = "FishingMap") void GenerateMap(); diff --git a/ProjectFish/Source/ProjectFish/Subsystem/FishingRodConfigSubsystem.cpp b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingRodConfigSubsystem.cpp similarity index 100% rename from ProjectFish/Source/ProjectFish/Subsystem/FishingRodConfigSubsystem.cpp rename to ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingRodConfigSubsystem.cpp diff --git a/ProjectFish/Source/ProjectFish/Subsystem/FishingRodConfigSubsystem.h b/ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingRodConfigSubsystem.h similarity index 100% rename from ProjectFish/Source/ProjectFish/Subsystem/FishingRodConfigSubsystem.h rename to ProjectFish/Source/ProjectFish/Gameplay/Subsystem/FishingRodConfigSubsystem.h