Add concrete component script field support
This commit is contained in:
@@ -23,7 +23,8 @@ enum class ScriptFieldType {
|
||||
Vector2,
|
||||
Vector3,
|
||||
Vector4,
|
||||
GameObject
|
||||
GameObject,
|
||||
Component
|
||||
};
|
||||
|
||||
struct GameObjectReference {
|
||||
@@ -38,6 +39,20 @@ struct GameObjectReference {
|
||||
}
|
||||
};
|
||||
|
||||
struct ComponentReference {
|
||||
uint64_t gameObjectUUID = 0;
|
||||
uint64_t scriptComponentUUID = 0;
|
||||
|
||||
bool operator==(const ComponentReference& other) const {
|
||||
return gameObjectUUID == other.gameObjectUUID
|
||||
&& scriptComponentUUID == other.scriptComponentUUID;
|
||||
}
|
||||
|
||||
bool operator!=(const ComponentReference& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
};
|
||||
|
||||
struct ScriptFieldMetadata {
|
||||
std::string name;
|
||||
ScriptFieldType type = ScriptFieldType::None;
|
||||
@@ -99,7 +114,8 @@ using ScriptFieldValue = std::variant<
|
||||
Math::Vector2,
|
||||
Math::Vector3,
|
||||
Math::Vector4,
|
||||
GameObjectReference>;
|
||||
GameObjectReference,
|
||||
ComponentReference>;
|
||||
|
||||
struct ScriptFieldDefaultValue {
|
||||
std::string fieldName;
|
||||
|
||||
Reference in New Issue
Block a user