瀏覽代碼

review changes

Signed-off-by: Adam Dabrowski <[email protected]>
Adam Dabrowski 2 年之前
父節點
當前提交
1582197601

+ 1 - 7
Project/Gem/Source/DemoStatistics/DemoStatisticsComponent.cpp

@@ -19,7 +19,6 @@ namespace AppleKraken
 {
     void DemoStatisticsComponent::Activate()
     {
-        AZ::TickBus::Handler::BusConnect();
         DemoStatisticsNotificationBus::Handler::BusConnect();
         m_applesGathered = 0;
         m_applesFailed = 0;
@@ -28,7 +27,6 @@ namespace AppleKraken
     void DemoStatisticsComponent::Deactivate()
     {
         DemoStatisticsNotificationBus::Handler::BusDisconnect();
-        AZ::TickBus::Handler::BusDisconnect();
     }
 
     void DemoStatisticsComponent::Reflect(AZ::ReflectContext* context)
@@ -62,6 +60,7 @@ namespace AppleKraken
         }
 
         m_applesGathered++;
+        DisplayNumberOfApples();
     }
 
     bool DemoStatisticsComponent::IsFailed(const Tags& tags)
@@ -105,9 +104,4 @@ namespace AppleKraken
         }
         UiTextBus::Event(uiTextEntity, &UiTextInterface::SetText, AZStd::string::format("%s %d", label.c_str(), counter));
     }
-
-    void DemoStatisticsComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time)
-    {
-        DisplayNumberOfApples();
-    }
 } // namespace AppleKraken

+ 0 - 3
Project/Gem/Source/DemoStatistics/DemoStatisticsComponent.h

@@ -10,7 +10,6 @@
 #include "DemoStatisticsNotifications.h"
 #include <AzCore/Component/Component.h>
 #include <AzCore/Component/EntityId.h>
-#include <AzCore/Component/TickBus.h>
 
 namespace AppleKraken
 {
@@ -18,7 +17,6 @@ namespace AppleKraken
     class DemoStatisticsComponent
         : public AZ::Component
         , private DemoStatisticsNotificationBus::Handler
-        , private AZ::TickBus::Handler
     {
     public:
         AZ_COMPONENT(DemoStatisticsComponent, "{C421B635-8B7A-479A-8617-86F5F1ACC4AE}");
@@ -32,7 +30,6 @@ namespace AppleKraken
     private:
         void DisplayNumberOfApples();
         void AddApple(const AppleEvent& appleEvent) override;
-        void OnTick(float deltaTime, AZ::ScriptTimePoint time) override;
 
         bool HasTag(const AppleEvent& appleEvent, const AZStd::string& tag);
         bool IsFailed(const Tags& tags);

+ 2 - 2
Project/Ui/GameCanvas.uicanvas

@@ -179,7 +179,7 @@
 									<Class name="AZ::Component" field="BaseClass1" type="{EDFCB2CF-F75D-43BE-B26B-F35821B29247}">
 										<Class name="AZ::u64" field="Id" value="232720424535605160" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
 									</Class>
-									<Class name="AZStd::string" field="Text" value="0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
+									<Class name="AZStd::string" field="Text" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
 									<Class name="bool" field="MarkupEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
 									<Class name="Color" field="Color" value="1.0000000 0.0000000 0.0000000 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
 									<Class name="float" field="Alpha" value="1.0000000" type="{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}"/>
@@ -254,7 +254,7 @@
 									<Class name="AZ::Component" field="BaseClass1" type="{EDFCB2CF-F75D-43BE-B26B-F35821B29247}">
 										<Class name="AZ::u64" field="Id" value="232720424535605160" type="{D6597933-47CD-4FC8-B911-63F3E2B0993A}"/>
 									</Class>
-									<Class name="AZStd::string" field="Text" value="0" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
+									<Class name="AZStd::string" field="Text" value="" type="{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9}"/>
 									<Class name="bool" field="MarkupEnabled" value="false" type="{A0CA880C-AFE4-43CB-926C-59AC48496112}"/>
 									<Class name="Color" field="Color" value="1.0000000 0.0000000 0.0000000 1.0000000" type="{7894072A-9050-4F0F-901B-34B1A0D29417}"/>
 									<Class name="float" field="Alpha" value="1.0000000" type="{EA2C3E90-AFBE-44D4-A90D-FAAF79BAF93D}"/>