You've already forked LuckyWorld
Merge pull request 'martin' (#31) from martin into main
Reviewed-on: LuckyRobots/LuckyWorldV2#31
This commit is contained in:
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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -242,7 +242,7 @@ FString ULuckyRobotsGameInstance::GetWriteFolderPath()
|
||||
return WriteFolderPath;
|
||||
}
|
||||
|
||||
TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh()
|
||||
TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh(FTransform& SpawnTransform)
|
||||
{
|
||||
int32 MeshCount = GetCurrentRandomMeshes().Num();
|
||||
if (MeshCount > 0)
|
||||
@ -250,7 +250,19 @@ TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh()
|
||||
int32 RandomIndex = UKismetMathLibrary::RandomIntegerInRange(0, MeshCount - 1);
|
||||
if (GetCurrentRandomMeshes().IsValidIndex(RandomIndex))
|
||||
{
|
||||
return GetCurrentRandomMeshes()[RandomIndex];
|
||||
TSoftObjectPtr<UStaticMesh> randommesh = (GetCurrentRandomMeshes()[RandomIndex]);
|
||||
|
||||
TArray<FSelectableItemData> SelectableItemList = GetSelectableItemList(EItemCategory::Furniture);
|
||||
for (auto SelectableItem : SelectableItemList)
|
||||
{
|
||||
if (SelectableItem.Mesh == randommesh)
|
||||
{
|
||||
SpawnTransform = SelectableItem.Transform;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return randommesh;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
FString GetWriteFolderPath();
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
TSoftObjectPtr<UStaticMesh> GetRandomMesh();
|
||||
TSoftObjectPtr<UStaticMesh> GetRandomMesh(FTransform& SpawnTransform);
|
||||
|
||||
UFUNCTION(BlueprintPure, Category = "Selectable Items")
|
||||
TArray<FSelectableItemData> GetSelectableItemList(EItemCategory ItemCategory);
|
||||
|
Reference in New Issue
Block a user