继续
This commit is contained in:
@@ -69,12 +69,13 @@ namespace Continentis.MainGame.Equipment
|
||||
{
|
||||
public static EquipmentBase GenerateEquipment(EquipmentData data, CharacterBase character = null)
|
||||
{
|
||||
Type logicType = data.haveCustomClass ? ModManager.GetType(data.classFullName) : typeof(EquipmentBase);
|
||||
string typeID = "NoFunctionEquipment";
|
||||
Type logicType = typeof(EquipmentBase);
|
||||
|
||||
if(logicType == null)
|
||||
if (data.haveCustomClass)
|
||||
{
|
||||
Debug.LogError($"Card class '{data.classFullName}' not found in assemblies.");
|
||||
return null;
|
||||
typeID = ModManager.GetTypeID(data.modName, "Equipments", data.className);
|
||||
logicType = ModManager.GetType(typeID);
|
||||
}
|
||||
|
||||
if (Activator.CreateInstance(logicType) is EquipmentBase equipment)
|
||||
@@ -85,7 +86,7 @@ namespace Continentis.MainGame.Equipment
|
||||
return equipment;
|
||||
}
|
||||
|
||||
Debug.LogError($"Failed to create equipment of type {data.classFullName}");
|
||||
Debug.LogError($"Failed to create equipment of type {typeID}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user