using System;
using System.Collections.Generic;
using UnityEngine.SceneManagement;
namespace FishNet.Managing.Scened
{
///
/// Data container about a scene unload start.
///
public struct SceneUnloadStartEventArgs
{
///
/// Queue data used by the current scene action.
///
public readonly UnloadQueueData QueueData;
internal SceneUnloadStartEventArgs(UnloadQueueData sqd)
{
QueueData = sqd;
}
}
///
/// Data container about a scene unload end.
///
public struct SceneUnloadEndEventArgs
{
///
/// Queue data used by the current scene action.
///
public readonly UnloadQueueData QueueData;
///
/// Handles of scenes which were successfully unloaded.
///
[Obsolete("Use UnloadedScenesV2")]
public int[] UnloadedSceneHandles;
///
/// Names of scenes which were successfully unloaded.
///
[Obsolete("Use UnloadedScenesV2")]
public string[] UnloadedSceneNames;
///
/// Scenes which were successfully unloaded.
/// This collection may be populated with empty scenes depending on engine version.
///
public List UnloadedScenes;
///
/// Unloaded scenes with names and handles cached.
/// This will be renamed as UnloadedScenes in Fish-Networking version 4.
///
public List UnloadedScenesV2;
internal SceneUnloadEndEventArgs(UnloadQueueData sqd, List unloadedScenes, List newUnloadedScenes)
{
QueueData = sqd;
UnloadedScenes = unloadedScenes;
UnloadedScenesV2 = newUnloadedScenes;
#pragma warning disable CS0618 // Type or member is obsolete
UnloadedSceneNames = new string[newUnloadedScenes.Count];
UnloadedSceneHandles = new int[newUnloadedScenes.Count];
for (int i = 0; i < newUnloadedScenes.Count; i++)
{
UnloadedSceneNames[i] = newUnloadedScenes[i].Name;
UnloadedSceneHandles[i] = newUnloadedScenes[i].Handle;
}
#pragma warning restore CS0618
}
}
}