public bool Sync(WeaponComponent comp, CompBaseValues sync) { if (sync.Revision > Revision) { Revision = sync.Revision; Set.Sync(comp, sync.Set); State.Sync(comp, sync.State, CompStateValues.Caller.CompData); for (int i = 0; i < Targets.Length; i++) { var w = comp.Platform.Weapons[i]; sync.Targets[i].SyncTarget(w, true); Reloads[i].Sync(w, sync.Reloads[i], true); } return(true); } return(false); }
public void Sync(WeaponComponent comp, CompBaseValues sync) { if (sync.Revision > Revision) { Revision = sync.Revision; Set.Sync(comp, sync.Set); State.Sync(comp, sync.State, CompStateValues.Caller.CompData); for (int i = 0; i < Targets.Length; i++) { var w = comp.Platform.Weapons[i]; sync.Targets[i].SyncTarget(w); Reloads[i].Sync(w, sync.Reloads[i]); } } else { Log.Line($"CompDynamicValues older revision"); } }
public override void CleanUp() { base.CleanUp(); Data = null; }