32 lines
1021 B
C#
32 lines
1021 B
C#
using System;
|
|
using SepCore.Entity;
|
|
using SepCore.Definition;
|
|
using UnityGameFramework.Runtime;
|
|
|
|
namespace SepCore.CustomUtility
|
|
{
|
|
public static class EntityDataFactory
|
|
{
|
|
public static EnemyConfig GetEnemyConfig(EnemyType enemyType)
|
|
{
|
|
return GameEntry.Luban.Get<EnemyConfig>((int)enemyType);
|
|
}
|
|
|
|
public static EnemyData Create(int entityId, EnemyType enemyType, int level)
|
|
{
|
|
return new EnemyData(entityId, GetEnemyConfig(enemyType), level);
|
|
}
|
|
|
|
public static WeaponData Create(int entityId, WeaponType weaponType, int ownerId, CampType ownerCamp)
|
|
{
|
|
var config = GameEntry.Luban.Get<WeaponConfig>((int)weaponType);
|
|
return new WeaponData(entityId, config, ownerId, ownerCamp);
|
|
}
|
|
|
|
public static WeaponData Create(int entityId, WeaponConfig config, int ownerId, CampType ownerCamp)
|
|
{
|
|
return new WeaponData(entityId, config, ownerId, ownerCamp);
|
|
}
|
|
}
|
|
}
|