feat:角色展示增加显示装备配置项

This commit is contained in:
m0_75251201
2025-11-18 19:12:34 +08:00
parent 6cb89ba439
commit bef0d43792
5 changed files with 11 additions and 8 deletions

View File

@@ -59,13 +59,13 @@ namespace CharacterPreview
var canvasObj = GameObject.Find("Canvas");
if (canvasObj == null)
{
Debug.Log("Canvas not found");
Debug.LogWarning("Canvas not found");
return;
}
var mainMenu=GameObjectUtils.FindObjectByPath(canvasObj, "MainMenuContainer");
if (!mainMenu)
{
Debug.Log("MainMenuContainer not found");
Debug.LogWarning("MainMenuContainer not found");
return;
}
@@ -101,11 +101,13 @@ namespace CharacterPreview
return;
}
Item item = await ItemSavesUtilities.LoadItem(characterItemSaveKey);
Item? item = null;
if (config.data.showEquipment)
{
item = await ItemSavesUtilities.LoadItem(characterItemSaveKey);
}
if (item == null)
{
Debug.Log($"[CreateCharacterModel] 未找到已保存的 {characterItemSaveKey},将使用默认角色模板创建新角色。");
var defaultTypeID = GameplayDataSettings.ItemAssets.DefaultCharacterItemTypeID;
item = await ItemAssetsCollection.InstantiateAsync(defaultTypeID);
if (item == null)
@@ -281,7 +283,7 @@ namespace CharacterPreview
}
public static CharacterMainControl CreateCharacter(
Item itemInstance,
Item? itemInstance,
CharacterModel modelPrefab,
Vector3 pos,
Quaternion rotation)