【资源路径】 移动 被保护目标 资源路径

main
刘涛 2024-11-04 18:28:09 +08:00
parent 30606228a4
commit 4317bb17e0
7 changed files with 20 additions and 12 deletions

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ea478dcf49cbf364ea5a9b42856336cb
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -29,14 +29,6 @@ MonoBehaviour:
AssetTags:
ActiveRuleName: EnableGroup
Collectors:
- CollectPath: Assets/_Test/Prefab
CollectorGUID: c9ef3e8404ba50a48b29e92ee09d5adc
CollectorType: 0
AddressRuleName: AddressByFileName
PackRuleName: PackDirectory
FilterRuleName: CollectPrefab
AssetTags:
UserData:
- CollectPath: Assets/Art/Scene/TireMark
CollectorGUID: 778348cc5a38284488657416460ee2ed
CollectorType: 0

View File

@ -10,6 +10,7 @@ using Gameplay.Performance;
using Gameplay.Skill;
using Gameplay.Unit;
using Gameplay.Unit.Data;
using Gameplay.Utils;
using LTGame;
using PhxhSDK;
using UnityEngine;
@ -70,11 +71,12 @@ namespace Gameplay.Fight.Protect
public async UniTask CreateAsync()
{
GameUnitManager.instance.RecordLoadPath(configData.modelPath);
var sampleObj = await AssetManager.Instance.LoadAssetAsync<GameObject>(configData.modelPath);
var modelPath = PathEx.GetProtectUnitModelPath(configData.modelPath);
GameUnitManager.instance.RecordLoadPath(modelPath);
var sampleObj = await AssetManager.Instance.LoadAssetAsync<GameObject>(modelPath);
if (sampleObj == null)
{
DebugUtil.LogError("加载BeProtectUnit失败: {0}", configData.modelPath);
DebugUtil.LogError("加载BeProtectUnit失败: {0}", modelPath);
return;
}
if (Node == null) return;

View File

@ -92,6 +92,12 @@ namespace Gameplay.Utils
return $"Assets/Art_Out/Manual/Battery/{batteryName}.prefab";
}
public static string GetProtectUnitModelPath(string modelName)
{
// Assets/Art_Out/Manual/Protect/P_V_50001.prefab
return $"Assets/Art_Out/Manual/Protect/{modelName}.prefab";
}
public static string GetFightBuildingModelPath(uint uid)
{
var cfg = TableManager.Instance.Tables.BuildConfig.Get((int)uid);

View File

@ -4,7 +4,7 @@
"VehicleType": 1,
"Name": "测试被保护目标",
"NameLocal": "",
"PrefabPath": "Assets/Art/Character/Prefabs/Protect/P_V_50001.prefab",
"PrefabPath": "P_V_50001",
"StandCrossLevel": 999,
"MoveCrossLevel": 1,
"Defense": 200,