Browse Source

Addressing PR

Signed-off-by: Olex Lozitskiy <[email protected]>
Olex Lozitskiy 3 năm trước cách đây
mục cha
commit
0a4c83d069

+ 4 - 4
Gems/RecastNavigation/Code/Include/RecastNavigation/RecastNavigationMeshBus.h

@@ -47,7 +47,7 @@ namespace RecastNavigation
 
         //! Notifies when a navigation mesh has started to re-calculate the navigation mesh.
         //! @param navigationMeshEntity the entity the navigation mesh is on. This is helpful for Script Canvas use.
-        virtual void OnNavigationMeshRecalculating(AZ::EntityId navigationMeshEntity) = 0;
+        virtual void OnNavigationMeshBeganRecalculating(AZ::EntityId navigationMeshEntity) = 0;
     };
 
     //! Notification EBus for a navigation mesh component.
@@ -61,7 +61,7 @@ namespace RecastNavigation
     public:
         AZ_EBUS_BEHAVIOR_BINDER(RecastNavigationNotificationHandler,
             "{819FF083-C28A-4620-B59E-78EB7D2CB432}",
-            AZ::SystemAllocator, OnNavigationMeshUpdated, OnNavigationMeshRecalculating);
+            AZ::SystemAllocator, OnNavigationMeshUpdated, OnNavigationMeshBeganRecalculating);
 
         //! Notifies when a navigation mesh is updated.
         //! @param navigationMeshEntity the entity with the navigation mesh. This makes for an easier to work in Script Cavnas.
@@ -72,9 +72,9 @@ namespace RecastNavigation
 
         //! Notifies when a navigation mesh has started to re-calculated navigation tile data.
         //! @param navigationMeshEntity the entity the navigation mesh is on. This is helpful for Script Canvas use.
-        void OnNavigationMeshRecalculating(AZ::EntityId navigationMeshEntity) override
+        void OnNavigationMeshBeganRecalculating(AZ::EntityId navigationMeshEntity) override
         {
-            Call(FN_OnNavigationMeshRecalculating, navigationMeshEntity);
+            Call(FN_OnNavigationMeshBeganRecalculating, navigationMeshEntity);
         }
     };
 } // namespace RecastNavigation

+ 5 - 5
Gems/RecastNavigation/Code/Source/Misc/RecastNavigationMeshComponentController.cpp

@@ -77,7 +77,7 @@ namespace RecastNavigation
             m_configuration.m_tileSize, aznumeric_cast<float>(m_configuration.m_borderSize) * m_configuration.m_cellSize);
 
         RecastNavigationMeshNotificationBus::Event(m_entityComponentIdPair.GetEntityId(),
-            &RecastNavigationMeshNotificationBus::Events::OnNavigationMeshRecalculating, m_entityComponentIdPair.GetEntityId());
+            &RecastNavigationMeshNotificationBus::Events::OnNavigationMeshBeganRecalculating, m_entityComponentIdPair.GetEntityId());
 
         {
             for (AZStd::shared_ptr<TileGeometry>& tile : tiles)
@@ -178,9 +178,9 @@ namespace RecastNavigation
             }
         }
 
-        m_context = {};
-        m_navObject = {};
-        m_taskGraphEvent = {};
+        m_context.reset();
+        m_navObject.reset();
+        m_taskGraphEvent.reset();
         m_updateInProgress = false;
 
         RecastNavigationMeshRequestBus::Handler::BusDisconnect();
@@ -441,7 +441,7 @@ namespace RecastNavigation
             m_taskGraph.SubmitOnExecutor(m_taskExecutor, m_taskGraphEvent.get());
 
             RecastNavigationMeshNotificationBus::Event(m_entityComponentIdPair.GetEntityId(),
-                &RecastNavigationMeshNotificationBus::Events::OnNavigationMeshRecalculating, m_entityComponentIdPair.GetEntityId());
+                &RecastNavigationMeshNotificationBus::Events::OnNavigationMeshBeganRecalculating, m_entityComponentIdPair.GetEntityId());
         }
     }
 } // namespace RecastNavigation

+ 2 - 1
Gems/RecastNavigation/Code/Source/Misc/RecastNavigationPhysXProviderComponentController.cpp

@@ -99,7 +99,8 @@ namespace RecastNavigation
         }
 
         RecastNavigationProviderRequestBus::Handler::BusDisconnect();
-        m_taskGraphEvent = {};
+        // The event is used to detect if tasks are already in progress.
+        m_taskGraphEvent.reset();
     }
 
     AZStd::vector<AZStd::shared_ptr<TileGeometry>> RecastNavigationPhysXProviderComponentController::CollectGeometry(

+ 9 - 9
Gems/RecastNavigation/Code/Tests/EditorNavigationMeshTest.cpp

@@ -97,23 +97,23 @@ namespace RecastNavigation
 
         void TearDown() override
         {
-            m_mockSimulatedBody = {};
-            m_mockPhysicsShape = {};
-            m_hit = {};
-            m_mockSceneInterface = {};
-            m_timeSystem = {};
+            m_mockSimulatedBody.reset();
+            m_mockPhysicsShape.reset();
+            m_hit.reset();
+            m_mockSceneInterface.reset();
+            m_timeSystem.reset();
 
             for (AZ::ComponentDescriptor* descriptor : *m_descriptors)
             {
                 delete descriptor;
             }
-            m_descriptors = {};
+            m_descriptors.reset();
 
-            m_sc = {};
-            m_bc = {};
+            m_sc.reset();
+            m_bc.reset();
 
             AZ::Interface<AZ::IConsole>::Unregister(m_console.get());
-            m_console = {};
+            m_console.reset();
             UnitTest::AllocatorsFixture::TearDown();
         }
 

+ 1 - 1
Gems/RecastNavigation/Code/Tests/MockInterfaces.h

@@ -89,7 +89,7 @@ namespace RecastNavigationTests
 
         int m_updatedCalls = 0;
 
-        void OnNavigationMeshRecalculating(AZ::EntityId) override
+        void OnNavigationMeshBeganRecalculating(AZ::EntityId) override
         {
             m_recalculatingCalls++;
         }