using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace Gaia
{
public enum PublicationType { Addressables, RegularBuild }
public enum ImpostorState { Unknown, NoTerrainLoading, ImpostorsNotCreated, ImpostorsCreated }
public enum BuildLogCategory
{
Impostors, ServerScene, CreatedAddressableConfig, AddressableBundles, ProjectBuild,
ColliderBaking,
UpdatedAddressableConfig
}
///
/// Stores an entry with build information for a specific (main) scene
///
[System.Serializable]
public class SceneBuildEntry
{
#if UNITY_EDITOR
public SceneAsset m_masterScene;
public SceneAsset m_serverScene;
public ImpostorState m_impostorState = ImpostorState.Unknown;
#endif
}
///
/// Stores an entry for the Build Log
///
[System.Serializable]
public class BuildLogEntry
{
public BuildLogCategory m_category;
public string m_sceneName = "";
public long m_timestamp;
}
public class BuildConfig : ScriptableObject
{
public PublicationType m_publicationType = PublicationType.RegularBuild;
#if UNITY_EDITOR
[Tooltip("The list of master scenes to be included for the addressable build.")]
public List m_sceneBuildEntries = new List();
#endif
[Tooltip("Entries for the Addressable build history.")]
public List m_buildHistory = new List();
///
/// Adds an entry to the build history for this config
///
/// The category of the entry
/// Name of the (main) scene this entry is logged for.
/// The unix timestamp to log for this category
public void AddBuildHistoryEntry(BuildLogCategory category, string sceneName, long timestamp)
{
m_buildHistory.Add(new BuildLogEntry() { m_category = category, m_sceneName = sceneName, m_timestamp = timestamp });
}
}
}