Files
Main/Assets/GameAssets/Resources/Lua/Common/CustomLib/Utility/AssetUtils.lua

117 lines
3.6 KiB
Lua
Raw Normal View History

2025-01-25 04:38:09 +08:00
------------------------------------------------
--作者: cy
--日期: 2019-07-1
--文件: AssetUtils.lua
--模块: AssetUtils
--描述: C#端的AssetUtils的lua版
------------------------------------------------
local CSLuaAssetUtils = CS.LuaAssetUtils
local L_GetPlayerBoneIndex = CSLuaAssetUtils.GetPlayerBoneIndex
local L_GetAssetFullPath = CSLuaAssetUtils.GetAssetFullPath
local L_GetAudioFilePath = CSLuaAssetUtils.GetAudioFilePath
local L_GetVideoFilePath = CSLuaAssetUtils.GetVideoFilePath
local L_GetAnimationPath = CSLuaAssetUtils.GetAnimationPath
local L_IsUIRes = CSLuaAssetUtils.IsUIRes
local L_GetModelTypeOutIndex = CSLuaAssetUtils.GetModelTypeOutIndex
local L_GetModelType = CSLuaAssetUtils.GetModelType
local L_GetModelAssetPath = CSLuaAssetUtils.GetModelAssetPath
local L_GetPlaceHolderModelAssetPath = CSLuaAssetUtils.GetPlaceHolderModelAssetPath
local L_GetImageAssetPath = CSLuaAssetUtils.GetImageAssetPath
local L_GetImageTypeCode = CSLuaAssetUtils.GetImageTypeCode
local L_IsVFXImagePath = CSLuaAssetUtils.IsVFXImagePath
local L_ProcessPath = CSLuaAssetUtils.ProcessPath
local L_GetPathWithOutExt = CSLuaAssetUtils.GetPathWithOutExt
local L_GetFileNameWithOutExt = CSLuaAssetUtils.GetFileNameWithOutExt
local L_MakeFileNameToLower = CSLuaAssetUtils.MakeFileNameToLower
local AssetUtils = {}
--获取玩家的骨骼信息
function AssetUtils.GetPlayerBoneIndex(modelID)
return L_GetPlayerBoneIndex(modelID)
end
--获取资源的全路径
function AssetUtils.GetAssetFullPath(relatePath, extension)
return L_GetAssetFullPath(relatePath, extension)
end
--获取声音文件路径
function AssetUtils.GetAudioFilePath(name, code)
return L_GetAudioFilePath(name, code)
end
--获取声音文件路径
function AssetUtils.GetVideoFilePath(name)
return L_GetVideoFilePath(name)
end
--获取动作路径
function AssetUtils.GetAnimationPath(ownerTypr, boneIndex, animClipName)
return L_GetAnimationPath(ownerTypr, boneIndex, animClipName)
end
--判断文件当前路径是否为UI
function AssetUtils.IsUIRes(filePath)
return L_IsUIRes(filePath)
end
--获取模型类型带out idx的该函数返回值有2个第1个是函数本身返回值第2个是out出来的值
function AssetUtils.GetModelTypeOutIndex(modelName)
return L_GetModelTypeOutIndex(modelName)
end
--获取模型类型不带out idx的
function AssetUtils.GetModelType(modelName)
return L_GetModelType(modelName)
end
--获取模型资源路径第3个参数isShow不传默认为false
function AssetUtils.GetModelAssetPath(type, code, isShow)
return L_GetModelAssetPath(type, code, isShow)
end
--获取模型的默认资源路径
function AssetUtils.GetPlaceHolderModelAssetPath(type, param)
return L_GetPlaceHolderModelAssetPath(type, param)
end
--获取图片的资源路径
function AssetUtils.GetImageAssetPath(code, name)
return L_GetImageAssetPath(code, name)
end
--获取图片类型码
function AssetUtils.GetImageTypeCode(texPath)
return L_GetImageTypeCode(texPath)
end
--是否是特效图片的路径
function AssetUtils.IsVFXImagePath(texPath)
return L_IsVFXImagePath(texPath)
end
--处理路径的分割符
function AssetUtils.ProcessPath(path)
return L_ProcessPath(path)
end
--获取Path,不带扩展名
function AssetUtils.GetPathWithOutExt(path)
return L_GetPathWithOutExt(path)
end
--获取FileName,不带扩展名
function AssetUtils.GetFileNameWithOutExt(path)
return L_GetFileNameWithOutExt(path)
end
--使某个路径的文件名小写的操作
function AssetUtils.MakeFileNameToLower(path)
return L_MakeFileNameToLower(path)
end
return AssetUtils