public PlayerSystem() : base() { // 初始化组件 c_model = new MainPlayerModelComponent(); c_position = new MoveComponent(); c_buff = new BuffComponent(); }
void Start() { moveComponent = GetComponent <IMoveComponent>(); jumpComponent = GetComponent <IJumpComponent>(); shootComponent = GetComponent <IShootComponent>(); groundDetection = GetComponent <GroundDetection>(); }
public virtual void Start() { this.Entity = entity; var navMeshComponent = this.GetComponent <NavMeshAgent>(); MoveComponent = new MoveComponent(navMeshComponent); AttackComponent = new AttackComponent(); }
public override void MappingCommand(IMoveComponent postComponent) { Dictionary <IInputEventService.VertualKey, AbstractMoveCommand> .KeyCollection keyCol = m_Dictionary.Keys; foreach (KeyValuePair <IInputEventService.VertualKey, AbstractMoveCommand> kvp in m_Dictionary) { if (ServiceLocator.getInputEventSetvice().IsActive(kvp.Key)) { MouseState ms = ServiceLocator.getInputEventSetvice().GetMouseState(); kvp.Value.Execute(postComponent, ms.offsetX, ms.offsetY, ms.zoomOffset, ms.X, ms.Y); } } }
private static void Physics() { for (int i = 0; i < entities.Count; i++) { //entities[i].PhysicsUpdate(); IMoveComponent mover = entities[i].GetComponent <IMoveComponent>(); if (mover != null) { ITargetDetector targetDetector = entities[i].GetComponent <ITargetDetector>(); if (targetDetector.Target == Object.NoId) { continue; } IEntity target = (IEntity)Object.GetById(targetDetector.Target); mover.MoveTowards(target.PositionX, target.PositionY); } } // TODO: Resolve physics. }
public override void Execute(IMoveComponent posComponent, float xOffset, float yOffset, float zoomOffset, float x, float y) { posComponent.Jump(ref ControllerCenter.Instance.playerSystem.GetMainPlayer().moveData); }
public abstract void Execute(IMoveComponent posComponent, float xOffset, float yOffset, float zoomOffset, float x, float y);
public ItemSystem() : base() { // 初始化组件 c_model = new ModelComponent(); c_position = new MoveComponent(); }
public abstract void MappingCommand(IMoveComponent postComponent);
public override void MappingCommand(IMoveComponent postComponent) { }