RollbackHelper.cs 706 B

12345678910111213141516171819202122232425262728293031
  1. namespace ET
  2. {
  3. public static class RollbackHelper
  4. {
  5. public static void Rollback(Entity entity)
  6. {
  7. if (entity is LSEntity)
  8. {
  9. return;
  10. }
  11. LSSington.Instance.Rollback(entity);
  12. if (entity.ComponentsCount() > 0)
  13. {
  14. foreach (var kv in entity.Components)
  15. {
  16. Rollback(kv.Value);
  17. }
  18. }
  19. if (entity.ChildrenCount() > 0)
  20. {
  21. foreach (var kv in entity.Children)
  22. {
  23. Rollback(kv.Value);
  24. }
  25. }
  26. }
  27. }
  28. }