how to handle ENTITY_EVENT_COMPONENT_PROPERTY_CHANGED event any code example ?

#1
Hi!
How to handle ENTITY_EVENT_COMPONENT_PROPERTY_CHANGED event any code exemple ?
the comments in code say's what
//! Called in the editor when a property of the selected entity changes. This is *not* sent when using IEntityPropertyGroup
//! nParam[0] = IEntityComponent pointer or nullptr
//! nParam[1] = Member id of the changed property, (@see IEntityComponent::GetClassDesc() FindMemberById(nParam[1]))

Re: how to handle ENTITY_EVENT_COMPONENT_PROPERTY_CHANGED event any code example ?

#4
What I usually do in this case is...
I create struct, for example struct SMyComponentProperties
This structure gathers all properties of my component and is entirely exposed to the editor.
Then in my component I create two variables of this structure type.
SMyComponentProperties m_properties;
and
SMyComponentProperties m_prevProperties;

m_properties is exposed to the editor, and prevProperties is not.
Now in Initialize function I assign:
m_prevProperties = m_properties;

From now on whenever m_properties value changes, I am able to compare it to m_prevProperties and see what values have changed.
Cryengine tutorial videos on my Youtube channel! Check it out !
https://www.youtube.com/user/MusicForLifePL20

Who is online

Users browsing this forum: No registered users and 0 guests