23 lines
555 B
C#

using Fantasy;
using Fantasy.Async;
using Fantasy.Entitas;
using Fantasy.Helper;
namespace Hotfix;
public static class GameAccountFactory
{
public static async FTask<GameAccount> Create(Scene scene, long accountId, bool isSaveToDatabase = true)
{
var gameAccount = Entity.Create<GameAccount>(scene,accountId,false,false);
gameAccount.CreateTime = TimeHelper.Now;
if (isSaveToDatabase)
{
await gameAccount.SaveToDatabase(scene);
}
return gameAccount;
}
}