public void UpdateState(PlayerProduct player) { foreach (IBuffProduct buff in m_buffs) { buff.Update(player); } }
public void Start() { PlayerFactory f = new PlayerFactory(); PlayerProduct p = f.CreatePlayer(0, 0, bornPoint.transform.position); ICameraService m_cc = new CameraService(camera); ServiceLocator.prodive(m_cc); // 通过工厂创建时技能的释放过程。 // 那技能的加载就是将技能命令提取出来。 IInputEventService m_ec = new InputEventService(); m_ec.SetKeyMapping(); ServiceLocator.prodive(m_ec); IMapService m_mpc = new MapService(terrain); ServiceLocator.prodive(m_mpc); // 控制器分开比较好,根据不同类型的命令分别写 IMoveControlService m_ic = new MoveControlService(); m_ic.AddCommand(IInputEventService.VertualKey.MOVE_FORWARD, new MoveForwardCommandImpl()); m_ic.AddCommand(IInputEventService.VertualKey.MOVE_BACK, new MoveBackCommandImpl()); m_ic.AddCommand(IInputEventService.VertualKey.MOVE_LEFT, new MoveLeftCommandImpl()); m_ic.AddCommand(IInputEventService.VertualKey.MOVE_RIGHT, new MoveRightCommandImpl()); m_ic.AddCommand(IInputEventService.VertualKey.MOVE_JUMP, new MoveJumpCommandImpl()); ServiceLocator.prodive(m_ic); IMouseControlService m_mc = new MouseControlService(); m_mc.AddCommand(IInputEventService.VertualKey.MOUSE_RIGHTBUTTON_DOWN, new CameraRightCommandImpl()); m_mc.AddCommand(IInputEventService.VertualKey.MOUSE_LEFTBUTTON_DOWN, new CameraLeftCommandImpl()); m_mc.AddCommand(IInputEventService.VertualKey.MOUSE_MIDBUTTON_DOWN, new CameraZoomCommandImpl()); ServiceLocator.prodive(m_mc); IActionControlService m_sc = new ActionControlService(); m_sc.AddCommand(IInputEventService.VertualKey.NUM_1, ACTION_ID.ACTION_RangeAttack1); m_sc.AddCommand(IInputEventService.VertualKey.NUM_2, ACTION_ID.ACTION_RangeAttack2); m_sc.AddCommand(IInputEventService.VertualKey.NUM_3, ACTION_ID.ACTION_SpecialAttack1); m_sc.AddCommand(IInputEventService.VertualKey.NUM_4, ACTION_ID.ACTION_SpecialAttack2); m_sc.AddCommand(IInputEventService.VertualKey.NUM_5, ACTION_ID.ACTION_Uppercut); m_sc.AddCommand(IInputEventService.VertualKey.NUM_6, ACTION_ID.ACTION_DasheBackward); m_sc.AddCommand(IInputEventService.VertualKey.NUM_7, ACTION_ID.ACTION_DasheForward); m_sc.AddCommand(IInputEventService.VertualKey.NUM_8, ACTION_ID.ACTION_Kick); m_sc.AddCommand(IInputEventService.VertualKey.NUM_9, ACTION_ID.ACTION_MoveAttack1); ServiceLocator.prodive(m_sc); }
public override PlayerProduct CreatePlayer(uint ID, uint modelID, Vector3 bornPosition) { PlayerProduct m_player; m_player = new PlayerProduct(ID, modelID, bornPosition); ControllerCenter.Instance.playerSystem.Add(ID, m_player); GameObject obj = GameObject.Instantiate(Resources.Load <GameObject>(PrefabMapping.Instance.PlayerModel[modelID])); obj.name = "MainPlayer"; ControllerCenter.Instance.renderSystem.Add(ID, obj.GetComponent <Renderer>()); ControllerCenter.Instance.gameobjectSystem.Add(ID, obj); return(m_player); }
public override void Execute(float xOffset, float yOffset, float zoomOffset, float x, float y) { MouseState ms = ServiceLocator.getInputEventSetvice().GetMouseState(); GameObject obj = ms.selectedItem; GameObject ob; bool Created = ControllerCenter.Instance.gameobjectSystem.Get(1, out ob); if (Created == true) { StripSimulate ss = ob.GetComponent <StripSimulate>(); if (ss != null) { ss.TrackPointB.transform.SetParent(obj.transform); ss.TrackPointB.transform.localPosition = Vector3.zero; } return; } if (obj != null && obj.name.StartsWith("HangerPoint")) { ItemFactory.CreateHangerItem(1, 0, obj.transform.position); if (ControllerCenter.Instance.gameobjectSystem.Get(1, out ob)) { StripSimulate ss = ob.GetComponent <StripSimulate>(); if (ss != null) { PlayerProduct pp = ControllerCenter.Instance.playerSystem.GetMainPlayer(); GameObject PlayerObject; if (ControllerCenter.Instance.gameobjectSystem.Get(0, out PlayerObject)) { if (ControllerCenter.Instance.gameobjectSystem.Get(0, out ob)) { ss.TrackPointA.SetParent(PlayerObject.transform); ss.TrackPointA.localPosition = Vector3.zero; ss.TrackPointB.SetParent(obj.transform); ss.TrackPointB.localPosition = Vector3.zero; } } } } } }
public abstract IBuffProduct CreatePostiveBuff(PlayerProduct player); // 增益buff public abstract IBuffProduct CreateNagtiveBuff(PlayerProduct player); // 减益buff
public abstract IBuffProduct CreateImtHurtBuff(PlayerProduct player); // 即刻伤害buff public abstract IBuffProduct CreatePostiveBuff(PlayerProduct player); // 增益buff
//buff也有很多分类,其实都可以使用一种buff来定义,暂时像这样写 public abstract IBuffProduct CreateImtHurtBuff(PlayerProduct player); // 即刻伤害buff
public abstract bool Update(List <IBuffProduct> lBuffs); //buff在角色身上 返回是否需要删除 public abstract bool Update(PlayerProduct player); //buff在角色身上 返回是否需要删除
public override bool Update(PlayerProduct player) { return(true); }
public override IBuffProduct CreateNagtiveBuff(PlayerProduct player) { BuffProduct buff = new BuffProduct(); return(buff); }
public override IBuffProduct CreateImtHurtBuff(PlayerProduct player) { BuffProduct buff = new BuffProduct(); return(buff); }