public unsafe override void LoadToObject(FakeStruct fake, Component game) { ConstantForceData *data = (ConstantForceData *)fake.ip; var obj = game.GetComponent <ConstantForce2D>(); if (obj == null) { return; } obj.force = data->force; obj.relativeForce = data->relativeForce; obj.torque = data->torque; }
public override unsafe FakeStruct LoadFromObject(Component com, DataBuffer buffer) { var ae = com as ConstantForce2D; if (ae == null) { return(null); } FakeStruct fake = new FakeStruct(buffer, ConstantForceData.ElementSize); ConstantForceData *data = (ConstantForceData *)fake.ip; data->force = ae.force; data->relativeForce = ae.relativeForce; data->torque = ae.torque; return(fake); }