using System;
using UnityEngine;
using UnityEngine.AddressableAssets.Initialization;
using UnityEngine.ResourceManagement.Util;
using UnityEngine.Serialization;
namespace UnityEditor.AddressableAssets.Settings
{
///
/// Asset container for CacheInitializationData.
///
[CreateAssetMenu(fileName = "CacheInitializationSettings.asset", menuName = "Addressables/Initialization/Cache Initialization Settings")]
public class CacheInitializationSettings : ScriptableObject, IObjectInitializationDataProvider
{
[FormerlySerializedAs("m_data")]
[SerializeField]
CacheInitializationData m_Data = new CacheInitializationData();
///
/// Display name used in GUI for this object.
///
public string Name { get { return "Asset Bundle Cache Settings"; } }
///
/// The cache initialization data that will be serialized and applied during Addressables initialization.
///
public CacheInitializationData Data
{
get
{
return m_Data;
}
set
{
m_Data = value;
}
}
///
/// Create initialization data to be serialized into the Addressables runtime data.
///
/// The serialized data for the initialization class and the data.
public ObjectInitializationData CreateObjectInitializationData()
{
return ObjectInitializationData.CreateSerializedInitializationData(typeof(CacheInitialization).Name, m_Data);
}
}
}