NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/GameWrapper/Team/TeamModelService.cs

148 lines
4.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using UnityEngine;
using Cysharp.Threading.Tasks;
namespace GameWrapper.Team
{
/// <summary>
/// 映射PaintType枚举避免直接依赖 注意后期修改 TODO 优化
/// </summary>
public enum TeamPaintType
{
None = 0,
Fort = 1,
CaterpillarBelt = 2,
Entirety = 3,
Max = 4,
}
/// <summary>
/// 角色添加数据
/// </summary>
public struct CharAddData
{
public uint ID;
public int Idx;
}
/// <summary>
/// 载具添加数据
/// </summary>
public struct VehicleAddData
{
public uint ID;
public int Idx;
}
/// <summary>
/// 载具接口
/// </summary>
public interface IVehicleModelService
{
//获取载具游戏模型路径
string GetVehicleGameModelPath(int vehicleId);
// 获取炮台模型路径
string GetBatteryModelPath(string modelPath);
// 获取载具涂装路径
string GetVehiclePaintPath(int vehicleID, int paintID);
// 获取载具涂装材质
UniTask<Material> GetVehiclePaintMaterial(string paintPath);
// 查找载具部件根节点
GameObject FindVehiclePartRoot(GameObject vehicleModel, int vehicleId, TeamPaintType type);
// 组合配置数据
object CombineConfigData(object vehicleData);
// 检查载具数据字典是否包含指定ID
bool VehicleDataDicContainsKey(uint id);
// 获取载具数据
object GetVehicleData(uint id);
// 获取载具发展数据
object GetVehicleDevelopment(uint id);
}
/// <summary>
/// 角色接口
/// </summary>
public interface ICharacterModelService
{
// 获取角色显示模型路径
string GetCharacterDisplayModelPath(string nameId);
// 检查角色数据字典是否包含指定ID
bool CharacterDataDicContainsKey(uint id);
// 获取角色数据
object GetCharacterData(uint id);
// 创建表情管理器
object CreateEmojiManager(GameObject go, string eyesColor, string eyeBrowsType, string eyeBrowsColor, bool isActive);
// 切换表情
void SwitchEmoji(object emojiManager, int emojiId);
// 释放表情管理器
void DisposeEmojiManager(object emojiManager);
}
/// <summary>
/// 编队队伍接口
/// </summary>
public interface ITeamService
{
// 获取团队信息
object GetTeamByIndex(int idx, bool isLegionBattle);
// 获取队伍中的所有角色ID
uint[] GetAllCharacters(object team);
// 获取队伍中的所有载具ID
uint[] GetVehicleIDs(object team);
// 获取默认团队ID
uint GetTeamNoneID();
// 获取载具Shader
Shader GetVehicleShader();
}
/// <summary>
/// 配置表接口
/// </summary>
public interface ITableService
{
// 获取皮肤配置
object GetSkinConfig(int skinID, int roleID);
// 获取电池配置
object GetBatteryConfig(long weaponId);
// 获取角色属性配置
bool TryGetCharacterAttriData(int id, out object data);
}
/// <summary>
/// 相机接口
/// </summary>
public interface ITeamEditCameraObj
{
Camera teamEditCamera { get; }
void SetCameraAntialiasing(Camera camera);
}
public static class TeamServiceHandle
{
public static IVehicleModelService VehicleService { get; set; }
public static ICharacterModelService CharacterService { get; set; }
public static ITeamService TeamService { get; set; }
public static ITableService TableService { get; set; }
public static ITeamEditCameraObj TeamEditCameraObj { get; set; }
}
}