158 lines
4.4 KiB
C#
158 lines
4.4 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using Thousandto.Core.Asset;
|
|||
|
|
|||
|
public class LuaAssetUtils
|
|||
|
{
|
|||
|
//静态方法获取玩家的骨骼信息
|
|||
|
public static int GetPlayerBoneIndex( int modelID )
|
|||
|
{
|
|||
|
return AssetUtils.GetPlayerBoneIndex( modelID );
|
|||
|
}
|
|||
|
|
|||
|
//获取资源的全路径
|
|||
|
public static string GetAssetFullPath( string relatePath, string extension )
|
|||
|
{
|
|||
|
return AssetUtils.GetAssetFullPath( relatePath, extension );
|
|||
|
}
|
|||
|
|
|||
|
//获取声音文件路径
|
|||
|
public static string GetAudioFilePath( string name, AudioTypeCode code )
|
|||
|
{
|
|||
|
return AssetUtils.GetAudioFilePath( name, code );
|
|||
|
}
|
|||
|
|
|||
|
//获取视频文件路径
|
|||
|
public static string GetVideoFilePath(string name)
|
|||
|
{
|
|||
|
return AssetUtils.GetVideoFilePath(name);
|
|||
|
}
|
|||
|
|
|||
|
//获取动作路径
|
|||
|
public static string GetAnimationPath( string ownerTypr, string boneIndex, string animClipName )
|
|||
|
{
|
|||
|
return AssetUtils.GetAnimationPath( ownerTypr, boneIndex, animClipName );
|
|||
|
}
|
|||
|
|
|||
|
//判断文件当前路径是否为UI
|
|||
|
public static bool IsUIRes( string filePath )
|
|||
|
{
|
|||
|
return AssetUtils.IsUIRes( filePath );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取模型类型
|
|||
|
/// </summary>
|
|||
|
/// <param name="modelName">模型的名字</param>
|
|||
|
/// <param name="idx">返回模型的索引</param>
|
|||
|
/// <returns></returns>
|
|||
|
public static ModelTypeCode GetModelTypeOutIndex( string modelName, out int idx )
|
|||
|
{
|
|||
|
return AssetUtils.GetModelType( modelName, out idx );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取模型类型
|
|||
|
/// </summary>
|
|||
|
/// <param name="modelName"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static ModelTypeCode GetModelType( string modelName )
|
|||
|
{
|
|||
|
return AssetUtils.GetModelType( modelName );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取模型资源路径
|
|||
|
/// </summary>
|
|||
|
/// <param name="type">模型类型</param>
|
|||
|
/// <param name="code">模型ID</param>
|
|||
|
/// <param name="isShow">是否展示</param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetModelAssetPath( ModelTypeCode type, int code, bool isShow = false )
|
|||
|
{
|
|||
|
return AssetUtils.GetModelAssetPath( type, code, isShow );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取模型的默认资源路径
|
|||
|
/// </summary>
|
|||
|
/// <param name="type">模型类型</param>
|
|||
|
/// <param name="param">
|
|||
|
/// 1.在获取角色的默认模型时的,职业参数信息.
|
|||
|
/// </param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetPlaceHolderModelAssetPath( ModelTypeCode type, int param = 1 )
|
|||
|
{
|
|||
|
return AssetUtils.GetPlaceHolderModelAssetPath( type, param );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取图片的资源路径
|
|||
|
/// </summary>
|
|||
|
/// <param name="code">图片类型</param>
|
|||
|
/// <param name="name">图片名字</param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetImageAssetPath( ImageTypeCode code, string name )
|
|||
|
{
|
|||
|
return AssetUtils.GetImageAssetPath( code, name );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取图片类型码
|
|||
|
/// </summary>
|
|||
|
/// <param name="texPath"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static ImageTypeCode GetImageTypeCode( string texPath )
|
|||
|
{
|
|||
|
return AssetUtils.GetImageTypeCode( texPath );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 是否是特效图片的路径
|
|||
|
/// </summary>
|
|||
|
/// <param name="texPath"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static bool IsVFXImagePath( string texPath )
|
|||
|
{
|
|||
|
return AssetUtils.IsVFXImagePath( texPath );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 处理路径的分割符
|
|||
|
/// </summary>
|
|||
|
/// <param name="path"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string ProcessPath( string path )
|
|||
|
{
|
|||
|
return AssetUtils.ProcessPath( path );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取Path,不带扩展名
|
|||
|
/// </summary>
|
|||
|
/// <param name="path"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetPathWithOutExt( string path )
|
|||
|
{
|
|||
|
return AssetUtils.GetPathWithOutExt( path );
|
|||
|
}
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 获取FileName,不带扩展名
|
|||
|
/// </summary>
|
|||
|
/// <param name="path"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public static string GetFileNameWithOutExt( string path )
|
|||
|
{
|
|||
|
return AssetUtils.GetFileNameWithOutExt( path );
|
|||
|
}
|
|||
|
|
|||
|
//使某个路径的文件名小写的操作
|
|||
|
public static string MakeFileNameToLower( string path )
|
|||
|
{
|
|||
|
return AssetUtils.MakeFileNameToLower( path );
|
|||
|
}
|
|||
|
}
|