- Más nuevo
- Más votos
- Más comentarios
I found my mistake It's raise an error with original engine's binaries and silently "doing nothing" with my compiled engine binaries - because of the line
AZ::EditContext* edit = serialize->GetEditContext();
need to be place in upper if-statment block (not out side it!). So working code now look like this -
void MyComponent::Reflect(AZ::ReflectContext *context)
{
AZ::SerializeContext* serialize = azrtti_cast<AZ::SerializeContext*>(context);
if (serialize)
{
serialize->Class<MyComponent, AZ::Component >()
->Version(1)
->Field("Value", &MyComponent::m_value)
;
AZ::EditContext* edit = serialize->GetEditContext();
if (edit)
{
edit->Class<MyComponent>("My Component", "")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "MyProject123")
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game"))
->DataElement(AZ::Edit::UIHandlers::Default, &MyComponent::m_value, "Value", "How much value is big.");
}
}
}
Yep, there is various UUID because I tried to generate few times new UUID, I'm just thinking maybe something wrong with it. But error raise with any UUID. Moreover, now I compile whole engine and if I register my custom component in discriptors table The LY Editor just won't starting (without any errors). And if I comment the registration of component the LYEditor starts fine. So what a cause of this behaviour ? Oo
The UUID for MyComponent in your header file is
{53C195D7-9D87-4B29-B964-16E08E728F36}
, which is not what's appearing in your error message. Are you sure you're building the right file?
I'm just using as a example code base in dir "Lumberyard\1.15.0.0\dev\MultiplayerSample\Gem\Code\Source\Components"
my component almost have the same major code parts, to showapping in editor's pop-up menu with components, and I'm just curious why it's not working for me? With original engine's binaries it was raising some error(prev. pic), but now it just silently ignore
Está publicación está cerrada: la opción de añadir nuevas respuestas, comentarios y votos está deshabilitada.
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 meses
- OFICIAL DE AWSActualizada hace un año