private void LoadPlayer() { PlayerEntityData playerEntityData = new PlayerEntityData(GameEntry.Entity.GenerateSerialId(), PathDefine.AssissnBattlePlayerId, ActorType.Player) { Name = "BattlePlayer", Position = m_MapCfg.playerBornPos, Rotation = Quaternion.Euler(m_MapCfg.playerBornRote), LocalScale = Vector3.one }; GameEntry.Entity.ShowMyPlayer(playerEntityData); PlayerData pd = PECommon.PlayerData; BattleProps props = new BattleProps { hp = pd.Hp, ad = pd.Ad, ap = pd.Ap, addef = pd.Addef, apdef = pd.Apdef, dodge = pd.Dodge, pierce = pd.Pierce, critical = pd.Critical }; EntitySelfPlayer = new EntityPlayer { BattleMgr = this, StateMgr = m_StateMgr, SkillMgr = m_SkillMgr }; EntitySelfPlayer.Name = "AssassinBattle"; EntitySelfPlayer.SetBattleProps(props); EntitySelfPlayer.Idle(); }
private void LoadPlayer() { playerEntityId = GameEntry.Entity.GenerateSerialId(); PlayerEntityData playerEntityData = new PlayerEntityData(GameEntry.Entity.GenerateSerialId(), PathDefine.AssissnCityPlayerId, ActorType.Player) { Name = "MainCityPlayer", Position = m_MapData.playerBornPos, Rotation = Quaternion.Euler(m_MapData.playerBornRote), LocalScale = new Vector3(1.5F, 1.5F, 1.5F) }; GameEntry.Entity.ShowMyPlayer(playerEntityData); }
public void Apply_PlayerEntity() { var p1 = new PlayerEntityData(2, 1); var p2 = new PlayerEntityData(3, 2); var mod1 = new FullEntity(p1, new MockBlockData()); var mod2 = new FullEntity(p2, new MockBlockData()); mod1.Apply(_game); mod2.Apply(_game); Assert.AreEqual(2, _game.Entities.Count); Assert.IsNotNull(_game.Entities[p1.Id] as PlayerEntity); Assert.IsNotNull(_game.PlayerEntities[p1.PlayerId]); Assert.AreEqual(p1.PlayerId, _game.PlayerEntities[p1.PlayerId].PlayerId); Assert.IsNotNull(_game.Entities[p2.Id] as PlayerEntity); Assert.IsNotNull(_game.PlayerEntities[p2.PlayerId]); Assert.AreEqual(p2.PlayerId, _game.PlayerEntities[p2.PlayerId].PlayerId); }
public static void ShowMyPlayer(this EntityComponent entityComponent, PlayerEntityData data) { entityComponent.ShowEntity(typeof(PlayerController), "Player", Constant.AssetPriority.Player, data); }
protected override void CustomSetup() { playerData = GameManager.Instance.player.Data as PlayerEntityData; }