// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System;
namespace Microsoft.MixedReality.Toolkit.SceneSystem
{
[Serializable]
public struct SceneInfo
{
public static SceneInfo Empty { get { return empty; } }
private static SceneInfo empty = default(SceneInfo);
///
/// Scene asset is not set.
///
public bool IsEmpty
{
get
{
return Asset == null;
}
}
///
/// Returns true if the asset is not null and if the scene has a valid build index. Doesn't respect whether scene is enabled in build settings.
///
public bool IsInBuildSettings
{
get
{
return Asset != null && Included;
}
}
public bool IsEnabled
{
get
{
return IsInBuildSettings & BuildIndex >= 0;
}
}
///
/// Name of the scene. Set by the property drawer.
///
public string Name;
///
/// Path of the scene. Set by the property drawer.
///
public string Path;
///
/// True if scene is included in build (NOT necessarily enabled)
///
public bool Included;
///
/// Build index of the scene. If included in build settings and enabled, this will be a value greater than zero.
/// If not included or disabled, this will be -1
///
public int BuildIndex;
///
/// Optional tag used to load and unload scenes in groups.
///
#if UNITY_EDITOR
[TagProperty]
#endif
public string Tag;
#if UNITY_EDITOR
[SceneAssetReference]
#endif
///
/// SceneAsset reference. Since SceneAsset is an editor-only asset, we store an object reference instead.
///
public UnityEngine.Object Asset;
}
}