CARLA
载入中...
搜索中...
未找到
Unreal
CarlaUE4
Plugins
Carla
Source
Carla
Actor
ActorSpawnResult.h
浏览该文件的文档.
1
// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2
// de Barcelona (UAB).
3
//
4
// This work is licensed under the terms of the MIT license.
5
// For a copy, see <https://opensource.org/licenses/MIT>.
6
7
#pragma once
8
9
#include "ActorSpawnResult.generated.h"
10
11
/// List of valid types for actor attributes.
12
UENUM(BlueprintType)
13
enum class
EActorSpawnResultStatus
: uint8
14
{
15
Success
UMETA
(DisplayName =
"Success"
),
16
InvalidDescription
UMETA
(DisplayName =
"Invalid actor description"
),
17
Collision
UMETA
(DisplayName =
"Failed because collision at spawn position"
),
18
UnknownError
UMETA
(DisplayName =
"Unknown Error"
),
19
20
SIZE
UMETA
(Hidden)
21
};
22
23
/// Result of an actor spawn function.
24
USTRUCT(BlueprintType)
25
struct
FActorSpawnResult
26
{
27
GENERATED_BODY()
28
29
FActorSpawnResult
() = default;
30
31
explicit
FActorSpawnResult
(
AActor
*InActor)
32
: Actor(InActor),
33
Status(Actor !=
nullptr
?
34
EActorSpawnResultStatus
::
Success
:
35
EActorSpawnResultStatus
::UnknownError) {}
36
37
static
FString StatusToString(
EActorSpawnResultStatus
Status);
38
39
bool
IsValid
()
const
40
{
41
return
(Actor !=
nullptr
) && (Status == EActorSpawnResultStatus::Success);
42
}
43
44
UPROPERTY(EditAnywhere, BlueprintReadWrite)
45
AActor
*Actor =
nullptr
;
46
47
UPROPERTY(EditAnywhere, BlueprintReadWrite)
48
EActorSpawnResultStatus
Status =
EActorSpawnResultStatus
::UnknownError;
49
};
EActorSpawnResultStatus
EActorSpawnResultStatus
List of valid types for actor attributes.
Definition
ActorSpawnResult.h:14
EActorSpawnResultStatus::UMETA
@ UMETA
CarlaRecorderPacketId::Collision
@ Collision
ECarlaServerResponse::Success
@ Success
AActor
FActorSpawnResult
Result of an actor spawn function.
Definition
ActorSpawnResult.h:26
FActorSpawnResult::IsValid
bool IsValid() const
Definition
ActorSpawnResult.h:39
制作者
1.10.0