/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include "StdAfx.h" #include "CloudsSystemComponent.h" namespace CloudsGem { void CloudsSystemComponent::Reflect(AZ::ReflectContext* context) { if (AZ::SerializeContext* serialize = azrtti_cast(context)) { serialize->Class() ->Version(1) ; if (AZ::EditContext* ec = serialize->GetEditContext()) { ec->Class("Clouds", "Initializes the clouds system") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "Game") ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) ->Attribute(AZ::Edit::Attributes::AutoExpand, true); } } } void CloudsSystemComponent::Activate() { CrySystemEventBus::Handler::BusConnect(); } void CloudsSystemComponent::Deactivate() { CrySystemEventBus::Handler::BusDisconnect(); } void CloudsSystemComponent::OnCrySystemInitialized(ISystem& system, const SSystemInitParams& systemInitParams) { #if !defined(AZ_MONOLITHIC_BUILD) // When module is linked dynamically, we must set our gEnv pointer. // When module is linked statically, we'll share the application's gEnv pointer. gEnv = system.GetGlobalEnvironment(); #endif } void CloudsSystemComponent::OnCrySystemShutdown(ISystem& system) { #if !defined(AZ_MONOLITHIC_BUILD) gEnv = nullptr; #endif } }