提交示例代码
This commit is contained in:
25
物品和背包的完整代码/Server/Hotfix/Gate/Helper/UnitFactory.cs
Normal file
25
物品和背包的完整代码/Server/Hotfix/Gate/Helper/UnitFactory.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace Fantasy;
|
||||
|
||||
public static class UnitFactory
|
||||
{
|
||||
public static Account CreatePlayer(Scene scene, uint configId, string userName, string password)
|
||||
{
|
||||
var account = Entity.Create<Account>(scene, true, true);
|
||||
account.ConfigId = configId;
|
||||
account.UserName = userName;
|
||||
account.Password = password;
|
||||
// 挂载容器组件
|
||||
account.AddComponent<ContainerComponent>();
|
||||
return account;
|
||||
}
|
||||
|
||||
public static Account CreateMonster(Scene scene, uint configId)
|
||||
{
|
||||
var account = Entity.Create<Account>(scene, true, true);
|
||||
// 挂载容器组件
|
||||
account.AddComponent<ContainerComponent>();
|
||||
return account;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user