20 lines
491 B
C++
20 lines
491 B
C++
#include "SexToyInstance.h"
|
|
|
|
#include "StructUtils/InstancedStruct.h"
|
|
|
|
void USexToyInstance::CaptureState(FInstancedStruct& OutState) const
|
|
{
|
|
FSexToyInstanceState State;
|
|
State.bActive = bActive;
|
|
State.Battery = Battery;
|
|
OutState.InitializeAs<FSexToyInstanceState>(State);
|
|
}
|
|
|
|
void USexToyInstance::ApplyState(const FInstancedStruct& InState)
|
|
{
|
|
if (const FSexToyInstanceState* State = InState.GetPtr<FSexToyInstanceState>())
|
|
{
|
|
bActive = State->bActive;
|
|
Battery = State->Battery;
|
|
}
|
|
} |