PrefabTestUndoFixture.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Prefab/PrefabTestUndoFixture.h>
  9. namespace UnitTest
  10. {
  11. void PrefabTestUndoFixture::SetupInstances(
  12. AZStd::unique_ptr<Instance>& firstInstance,
  13. AZStd::unique_ptr<Instance>& secondInstance,
  14. TemplateId& ownerId,
  15. TemplateId& referenceId)
  16. {
  17. //create two prefabs for test
  18. //create prefab 1
  19. firstInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({}, {}, "test/path0"));
  20. ASSERT_TRUE(firstInstance);
  21. //get template id
  22. ownerId = firstInstance->GetTemplateId();
  23. //create prefab 2
  24. secondInstance = AZStd::move(m_prefabSystemComponent->CreatePrefab({}, {}, "test/path1"));
  25. ASSERT_TRUE(secondInstance);
  26. //get template id
  27. referenceId = secondInstance->GetTemplateId();
  28. }
  29. }