public unsafe override void LoadToComponent(FakeStruct fake, Component game, FakeStruct main) { AreaEffectData *data = (AreaEffectData *)fake.ip; var obj = game.GetComponent <AreaEffector2D>(); if (obj == null) { return; } obj.useColliderMask = data->useColliderMask; obj.colliderMask = data->colliderMask; obj.forceAngle = data->forceAngle; obj.useGlobalAngle = data->useGlobalAngle; obj.forceMagnitude = data->forceMagnitude; obj.forceVariation = data->forceVariation; obj.drag = data->drag; obj.angularDrag = data->angularDrag; obj.forceTarget = data->forceTarget; }
public override unsafe FakeStruct LoadFromObject(Component com, DataBuffer buffer) { var ae = com as AreaEffector2D; if (ae == null) { return(null); } FakeStruct fake = new FakeStruct(buffer, AreaEffectData.ElementSize); AreaEffectData *data = (AreaEffectData *)fake.ip; data->useColliderMask = ae.useColliderMask; data->colliderMask = ae.colliderMask; data->forceAngle = ae.forceAngle; data->useGlobalAngle = ae.useGlobalAngle; data->forceMagnitude = ae.forceMagnitude; data->forceVariation = ae.forceVariation; data->drag = ae.drag; data->angularDrag = ae.angularDrag; data->forceTarget = ae.forceTarget; return(fake); }