예제 #1
0
 public PlayerSystem() : base()
 {
     // 初始化组件
     c_model    = new MainPlayerModelComponent();
     c_position = new MoveComponent();
     c_buff     = new BuffComponent();
 }
예제 #2
0
 void Start()
 {
     moveComponent   = GetComponent <IMoveComponent>();
     jumpComponent   = GetComponent <IJumpComponent>();
     shootComponent  = GetComponent <IShootComponent>();
     groundDetection = GetComponent <GroundDetection>();
 }
예제 #3
0
        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.
        }
예제 #6
0
 public override void Execute(IMoveComponent posComponent, float xOffset, float yOffset, float zoomOffset, float x, float y)
 {
     posComponent.Jump(ref ControllerCenter.Instance.playerSystem.GetMainPlayer().moveData);
 }
예제 #7
0
 public abstract void Execute(IMoveComponent posComponent, float xOffset, float yOffset, float zoomOffset, float x, float y);
예제 #8
0
 public ItemSystem() : base()
 {
     // 初始化组件
     c_model    = new ModelComponent();
     c_position = new MoveComponent();
 }
 public abstract void MappingCommand(IMoveComponent postComponent);
예제 #10
0
 public override void MappingCommand(IMoveComponent postComponent)
 {
 }