|
@@ -9,26 +9,35 @@ namespace ET.Server
|
|
|
[FriendOf(typeof (BattleIceAgentComponent))]
|
|
|
public static class PlayerSystem
|
|
|
{
|
|
|
- public class PlayerAwakeSystem: AwakeSystem<WNPlayer, Session, PlayerInfo>
|
|
|
+ public class PlayerAwakeSystem: AwakeSystem<WNPlayer, Session>
|
|
|
{
|
|
|
- /// <summary>
|
|
|
- /// 玩家实体创建
|
|
|
- /// </summary>
|
|
|
- /// <param name="self"></param>
|
|
|
- /// <param name="session"></param>
|
|
|
- /// <param name="playerInfo"></param>
|
|
|
- protected override void Awake(WNPlayer self, Session session, PlayerInfo playerInfo)
|
|
|
+ protected override void Awake(WNPlayer self, Session session)
|
|
|
{
|
|
|
Log.Info($"创建玩家实体...");
|
|
|
+ PlayerInfo playerInfo = session.GetComponent<SessionPlayerComponent>().PlayerInfo;
|
|
|
+
|
|
|
+ // 绑定sessionId
|
|
|
+ self.GameSessionActorId = session.InstanceId;
|
|
|
+ self.Session = session;
|
|
|
+ self.BasicProp = CharacterConfigCategory.Instance.Get(playerInfo.Pro);
|
|
|
+ self.BornType = (int)BORN_TYPE.NORMAL;
|
|
|
+ self.EnterState = (int)ENTER_STATE.online;
|
|
|
+
|
|
|
+ // 玩家基础数据组件
|
|
|
+ self.AddComponent<PlayerDataComponent, PlayerInfo>(playerInfo);
|
|
|
+ // 玩家临时数据组件
|
|
|
+ self.AddComponent<PlayerTempDataComponent>().Init();
|
|
|
+ // 玩家技能组件
|
|
|
+ self.AddComponent<PlayerSkillComponent>().Init();
|
|
|
+ // 玩家货币组件
|
|
|
+ self.AddComponent<PlayerMoneyComponent>().Init();
|
|
|
+ // 玩家属性组件
|
|
|
+ self.AddComponent<PlayerBtlComponent>().Init();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public class PlayerDestroySystem: DestroySystem<WNPlayer>
|
|
|
{
|
|
|
- /// <summary>
|
|
|
- /// 玩家实体销毁
|
|
|
- /// </summary>
|
|
|
- /// <param name="self"></param>
|
|
|
protected override void Destroy(WNPlayer self)
|
|
|
{
|
|
|
Log.Info($"销毁玩家实体...");
|