public EntitySystem(IClientGlobal clientGlobal) { EntitySystem.m_ClientGlobal = clientGlobal; MaxPlayer = 500; // 默认设置一个较大值 bOnlyCreateMainPlayer = PlayerPrefs.GetInt("eOnlyCreatMainPlayer", 0) == 1 ? true : false; SearchRange = GameTableManager.Instance.GetGlobalConfig <uint>("Auto_Combat_Rang"); }
public static ISkillSystem CreateSkillSystem(IClientGlobal clientGlobal) { if (m_SkillSys == null) { m_SkillSys = new SkillSystem(clientGlobal); } return(m_SkillSys); }
/** * @brief 初始化 * @param ClientGlobal对象 */ public void Init(IClientGlobal ClientGlobal) { m_ClientGlobal = ClientGlobal; Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.ENTITYSYSTEM_ENTITYSTOPMOVE, OnContrllerEvent); Engine.Utility.EventEngine.Instance().AddEventListener((int)Client.GameEventID.ENTITYSYSTEM_ENTITYDEAD, OnContrllerEvent); Engine.Utility.EventEngine.Instance().AddEventListener((int)(int)Client.GameEventID.SKILL_FORBIDDENJOYSTICK, OnContrllerEvent); Engine.Utility.EventEngine.Instance().AddEventListener((int)(int)Client.GameEventID.SKLL_LONGPRESS, OnContrllerEvent); }
public static IControllerSystem CreateControllerSystem(IClientGlobal clientGlobal) { if (m_ControllerSys == null) { m_ControllerSys = new ControllerSystem(clientGlobal); } return(m_ControllerSys); }
public static IEntitySystem CreateEntitySystem(IClientGlobal clientGlobal) { if (m_EntitySys == null) { m_EntitySys = new EntitySystem(clientGlobal); } return(m_EntitySys); }
//private MissionRobot m_MissionRobot = null; public ControllerSystem(IClientGlobal clientGlobal) { m_ClientGlobal = clientGlobal; m_ActiveCtrl = new Controller(m_ClientGlobal); m_CombatRobot = new CombatRobot(); m_switchTargt = new SwitchTarget(); //m_MissionRobot = new MissionRobot(); }
public static IMapSystem CreateMapSystem(IClientGlobal clientGlobal, bool bEditor = false) { if (m_MapSys == null) { m_MapSys = new MapSystem(clientGlobal); if (!m_MapSys.Create(bEditor)) { return(null); } } return(m_MapSys); }
public bool Conform(INPC en) { IClientGlobal cg = SkillSystem.GetClientGlobal(); IEntity player = cg.MainPlayer; ISkillPart skillPart = (ISkillPart)player.GetPart(EntityPart.Skill); SkillDatabase db = skillPart.GetCurSkillDataBase(); if (db != null) { float dis = EntitySystem.EntityHelper.GetEntityDistance(player, en); if (dis <= db.dwAttackDis) { return(true); } } return(false); }
public MapSystem(IClientGlobal clientGlobal) { MapSystem.m_ClientGlobal = clientGlobal; }
public PlayerBuffPart(IClientGlobal clientGlobal, SkillSystem skillSystem) { m_ClientGlobal = clientGlobal; TimerAxis.Instance().SetTimer(m_ubuffCountDownTimerID, 500, this); }
public SkillSystem(IClientGlobal clientGlobal) { m_ClientGlobal = clientGlobal; m_danmagemanager = new DamageManager(); }
/* * 技能范围 对园和扇形是半径 对于矩形是长 * 技能范围参数 对园和扇形是角度 对于矩形是宽 */ /// <summary> /// /// </summary> /// <param name="en">技能目标</param> /// <returns></returns> public bool Conform(IPlayer en) { if (en == null) { Log.LogGroup("ZDY", " confirm player is null"); return(false); } IClientGlobal cg = SkillSystem.GetClientGlobal(); IEntity player = cg.MainPlayer; ISkillPart skillPart = (ISkillPart)player.GetPart(EntityPart.Skill); SkillDatabase db = skillPart.GetCurSkillDataBase(); Vector3 mytempPos = player.GetPos(); Vector3 targettempPos = en.GetPos(); Vector2 mypos = new Vector2(mytempPos.x, mytempPos.z); Vector2 targetpos = new Vector2(targettempPos.x, targettempPos.z); float dis = EntitySystem.EntityHelper.GetEntityDistance(player, en); if (db != null) { if (db.areaType == 0) { //点 } else if (db.areaType == 1) { //矩形 Log.Error("not implementations "); return(false); } else if (db.areaType == 2) { Transform trans = player.GetTransForm(); if (trans == null) { return(false); } //扇形 Vector2 myDir = new Vector2(trans.forward.x, trans.forward.z); Vector2 dir = targetpos - mypos; float angle = Vector2.Angle(myDir.normalized, dir.normalized); float dbAngle = db.skillAreaParam / 2; if (dbAngle > angle) { if (dis < db.skillArea) { return(true); } } return(false); } else if (db.areaType == 3) { //园 if (dis < db.skillArea) { return(true); } } } return(false); }