Ejemplo n.º 1
0
        public void Action()
        {
            var postionCom = EntityManager.GetEntiy <GameObject>(EntID).GetComponent <IHaveHitBoxCom>(PostionAlais);

            var shooterHitbox = postionCom.HitBox;

            var nextEntry = EntiyBlueprintManger.Get(BulletBlueprint);
            var hitbox    = nextEntry.GetbyAlais <RectPosCom>("pos").Paultangle;

            Postion2D nextPostion;

            switch (ExitDirection)
            {
            case DirectionTypes.Up:
                throw new NotImplementedException();
                break;

            case DirectionTypes.Down:
                throw new NotImplementedException();
                break;

            case DirectionTypes.Left:
                nextPostion = new Postion2D
                              (
                    shooterHitbox.Left - hitbox.Width - 2,
                    (shooterHitbox.Y + shooterHitbox.Height / 2) - hitbox.Height / 2
                              );
                break;

            case DirectionTypes.Right:
                nextPostion = new Postion2D
                              (
                    shooterHitbox.Right - hitbox.Width + 3,
                    (shooterHitbox.Y + shooterHitbox.Height / 2) - hitbox.Height / 2
                              );
                break;

            default:
                throw new NotImplementedException();
            }

            hitbox.Postion2D = nextPostion;

            if (nextEntry.HasAlias("move_direction_com"))
            {
                var moveDirectionCom = nextEntry.GetbyAlais <MoveDirectionCom>("move_direction_com");
                moveDirectionCom.Direction = ExitDirection;
            }

            SenceManger.AddProcessedToMain(GameObjectFactory.AddCreatedGameObject(nextEntry, new List <IPassValue>()));
        }
Ejemplo n.º 2
0
        public void Action()
        {
            var nextEntry = EntiyBlueprintManger.Get(BlueprintName);

            SenceManger.AddProcessedToMain(GameObjectFactory.AddCreatedGameObject(nextEntry, new List <IPassValue>()));
        }