You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.4 KiB
C++
73 lines
2.4 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#include <AzCore/Asset/AssetManager.h>
|
|
#include <AzCore/Serialization/SerializeContext.h>
|
|
|
|
#include <ScriptCanvas/Asset/RuntimeAsset.h>
|
|
#include <ScriptCanvas/Asset/RuntimeAssetHandler.h>
|
|
#include <Asset/RuntimeAssetSystemComponent.h>
|
|
#include <Asset/SubgraphInterfaceAssetHandler.h>
|
|
|
|
namespace ScriptCanvas
|
|
{
|
|
RuntimeAssetSystemComponent::~RuntimeAssetSystemComponent()
|
|
{
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::Reflect(AZ::ReflectContext* context)
|
|
{
|
|
RuntimeData::Reflect(context);
|
|
RuntimeDataOverrides::Reflect(context);
|
|
SubgraphInterfaceData::Reflect(context);
|
|
|
|
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
|
|
{
|
|
serializeContext->Class<RuntimeAssetSystemComponent, AZ::Component>()
|
|
->Version(0)
|
|
;
|
|
}
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
|
{
|
|
provided.push_back(AZ_CRC("ScriptCanvasRuntimeAssetService", 0x1a85bf2b));
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
|
|
{
|
|
required.push_back(AZ_CRC("AssetDatabaseService", 0x3abf5601));
|
|
required.push_back(AZ_CRC("ScriptCanvasService", 0x41fd58f3));
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
|
|
{
|
|
dependent.push_back(AZ_CRC("AssetCatalogService", 0xc68ffc57));
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::Init()
|
|
{
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::Activate()
|
|
{
|
|
m_runtimeAssetRegistry.Register<ScriptCanvas::RuntimeAsset, ScriptCanvas::RuntimeAssetHandler, ScriptCanvas::RuntimeAssetDescription>();
|
|
m_runtimeAssetRegistry.Register<ScriptCanvas::SubgraphInterfaceAsset, ScriptCanvas::SubgraphInterfaceAssetHandler, ScriptCanvas::SubgraphInterfaceAssetDescription>();
|
|
}
|
|
|
|
void RuntimeAssetSystemComponent::Deactivate()
|
|
{
|
|
m_runtimeAssetRegistry.Unregister();
|
|
}
|
|
|
|
AssetRegistry& RuntimeAssetSystemComponent::GetAssetRegistry()
|
|
{
|
|
return m_runtimeAssetRegistry;
|
|
}
|
|
|
|
}
|