根据节点类型不同,触发不同的节点事件
This commit is contained in:
parent
b6b7f2a411
commit
d6df1f4f7a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -28,4 +28,7 @@ public:
|
|||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= MapConfig, meta = (ToolTip = "节点垂直间距"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= MapConfig, meta = (ToolTip = "节点垂直间距"))
|
||||||
int32 NodeOffsetY = 300;
|
int32 NodeOffsetY = 300;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category= MapConfig, meta = (ToolTip = "战斗节点名称"))
|
||||||
|
FName BattleMapName = FName(TEXT("Dabaza"));
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#include "FishingMapSystem.h"
|
#include "FishingMapSystem.h"
|
||||||
#include "Engine/Engine.h"
|
#include "Engine/Engine.h"
|
||||||
|
#include "Kismet/GameplayStatics.h"
|
||||||
#include "ProjectFish/DataAsset/MapConfigAsset.h"
|
#include "ProjectFish/DataAsset/MapConfigAsset.h"
|
||||||
|
|
||||||
UFishingMapNode::UFishingMapNode()
|
UFishingMapNode::UFishingMapNode()
|
||||||
@ -87,6 +88,19 @@ void UFishingMapSystem::MoveToNode(FGuid NodeID)
|
|||||||
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Immovable);
|
OnNodeStateChange.Broadcast(node->NodeID, EMapNodeState::Immovable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//根据节点类型 触发不同的事件
|
||||||
|
UFishingMapNode* node = GetNode(NodeID);
|
||||||
|
switch (node->NodeType)
|
||||||
|
{
|
||||||
|
case EMapNodeType::Battle:
|
||||||
|
UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName);
|
||||||
|
break;
|
||||||
|
case EMapNodeType::Boss:
|
||||||
|
UGameplayStatics::OpenLevel(this, MapConfig->BattleMapName);
|
||||||
|
break;
|
||||||
|
case EMapNodeType::Skill:
|
||||||
|
break;;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user