public virtual CCPhysicsBody AddBodyOrDelay(CCPhysicsBody body) { CCPhysicsBody removeBodyIter = DelayRemoveBodies.Find(b => b == body); if (removeBodyIter != null) { DelayRemoveBodies.Remove(removeBodyIter); return(null); } if (Info.IsLocked()) { if (DelayAddBodies.Exists(b => b == body)) { DelayAddBodies.Add(body); DelayDirty = true; } } else { DoAddBody(body); } return(body); }
public virtual void RemoveBodyOrDelay(CCPhysicsBody body) { if (DelayAddBodies.Exists(b => b == body)) { DelayAddBodies.Remove(body); return; } if (Info.IsLocked()) { if (DelayRemoveBodies.Exists(b => b == body)) { DelayRemoveBodies.Add(body); DelayDirty = true; } } else { DoRemoveBody(body); } }