2023-02-11 03:33:30 +00:00
|
|
|
#include "MutableModelBehaviorComponent.h"
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
MutableModelBehaviorComponent::MutableModelBehaviorComponent(Entity* parent) : Component(parent) {
|
|
|
|
m_DirtyModelBehaviorInfo = false;
|
|
|
|
m_BehaviorCount = 0;
|
|
|
|
m_IsPaused = true;
|
|
|
|
|
|
|
|
m_DirtyModelEditingInfo = false;
|
|
|
|
m_OldObjId = LWOOBJID_EMPTY;
|
|
|
|
m_Editor = LWOOBJID_EMPTY;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MutableModelBehaviorComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsInitialUpdate, unsigned int& flags) {
|
|
|
|
outBitStream->Write(m_DirtyModelBehaviorInfo || bIsInitialUpdate);
|
2023-07-10 03:56:04 +00:00
|
|
|
if (m_DirtyModelBehaviorInfo || bIsInitialUpdate) {
|
2023-02-11 03:33:30 +00:00
|
|
|
outBitStream->Write(m_BehaviorCount);
|
|
|
|
outBitStream->Write(m_IsPaused);
|
|
|
|
|
2023-07-10 03:56:04 +00:00
|
|
|
outBitStream->Write(m_DirtyModelEditingInfo && bIsInitialUpdate);
|
|
|
|
if (m_DirtyModelEditingInfo && bIsInitialUpdate) {
|
|
|
|
outBitStream->Write(m_OldObjId);
|
|
|
|
outBitStream->Write(m_Editor);
|
|
|
|
if (!bIsInitialUpdate) m_DirtyModelEditingInfo = false;
|
|
|
|
}
|
|
|
|
if (!bIsInitialUpdate) m_DirtyModelBehaviorInfo = false;
|
2023-02-11 03:33:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|