using System;
using Cysharp.Threading.Tasks;
using UnityEngine.SceneManagement;
namespace TEngine
{
public interface ISceneModule
{
///
/// 当前主场景名称。
///
public string CurrentMainSceneName { get; }
///
/// 加载场景。
///
/// 场景的定位地址
/// 场景加载模式
/// 加载完毕时是否主动挂起
/// 优先级
/// 加载主场景是否回收垃圾。
/// 加载进度回调。
public UniTask LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, bool suspendLoad = false, uint priority = 100, bool gcCollect = true,
Action progressCallBack = null);
///
/// 加载场景。
///
/// 场景的定位地址
/// 场景加载模式
/// 加载完毕时是否主动挂起
/// 优先级
/// 加载回调。
/// 加载主场景是否回收垃圾。
/// 加载进度回调。
public void LoadScene(string location,
LoadSceneMode sceneMode = LoadSceneMode.Single,
bool suspendLoad = false,
uint priority = 100,
Action callBack = null,
bool gcCollect = true,
Action progressCallBack = null);
///
/// 激活场景(当同时存在多个场景时用于切换激活场景)。
///
/// 场景资源定位地址。
/// 是否操作成功。
public bool ActivateScene(string location);
///
/// 解除场景加载挂起操作。
///
/// 场景资源定位地址。
/// 是否操作成功。
public bool UnSuspend(string location);
///
/// 是否为主场景。
///
/// 场景资源定位地址。
/// 是否主场景。
public bool IsMainScene(string location);
///
/// 异步卸载子场景。
///
/// 场景资源定位地址。
/// 进度回调。
public UniTask UnloadAsync(string location, Action progressCallBack = null);
///
/// 异步卸载子场景。
///
/// 场景资源定位地址。
/// 卸载完成回调。
/// 进度回调。
public void Unload(string location, Action callBack = null, Action progressCallBack = null);
///
/// 是否包含场景。
///
/// 场景资源定位地址。
/// 是否包含场景。
public bool IsContainScene(string location);
}
}