Merge pull request 'martin' (#31) from martin into main
Reviewed-on: #31
This commit is contained in:
commit
605f6b8be0
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;
|
return WriteFolderPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh()
|
TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh(FTransform& SpawnTransform)
|
||||||
{
|
{
|
||||||
int32 MeshCount = GetCurrentRandomMeshes().Num();
|
int32 MeshCount = GetCurrentRandomMeshes().Num();
|
||||||
if (MeshCount > 0)
|
if (MeshCount > 0)
|
||||||
@ -250,7 +250,19 @@ TSoftObjectPtr<UStaticMesh> ULuckyRobotsGameInstance::GetRandomMesh()
|
|||||||
int32 RandomIndex = UKismetMathLibrary::RandomIntegerInRange(0, MeshCount - 1);
|
int32 RandomIndex = UKismetMathLibrary::RandomIntegerInRange(0, MeshCount - 1);
|
||||||
if (GetCurrentRandomMeshes().IsValidIndex(RandomIndex))
|
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();
|
FString GetWriteFolderPath();
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure)
|
UFUNCTION(BlueprintPure)
|
||||||
TSoftObjectPtr<UStaticMesh> GetRandomMesh();
|
TSoftObjectPtr<UStaticMesh> GetRandomMesh(FTransform& SpawnTransform);
|
||||||
|
|
||||||
UFUNCTION(BlueprintPure, Category = "Selectable Items")
|
UFUNCTION(BlueprintPure, Category = "Selectable Items")
|
||||||
TArray<FSelectableItemData> GetSelectableItemList(EItemCategory ItemCategory);
|
TArray<FSelectableItemData> GetSelectableItemList(EItemCategory ItemCategory);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user