Пример #1
0
    bool DetonationCheck(GameObject torpedo, ShipEntity shooter)
    {
        //Debug.DrawLine(torpedo.transform.position, torpedo.transform.position + (torpedo.transform.up * _detonationRange), Color.red, 2f);
        //Debug.DrawLine(torpedo.transform.position, torpedo.transform.position + (-torpedo.transform.up * _detonationRange), Color.red, 2f);
        //Debug.DrawLine(torpedo.transform.position, torpedo.transform.position + (torpedo.transform.right * _detonationRange), Color.red, 2f);
        //Debug.DrawLine(torpedo.transform.position, torpedo.transform.position + (-torpedo.transform.right * _detonationRange), Color.red, 2f);

        List <ShipEntity> targets = new List <ShipEntity>();

        for (int i = 0; i < GameManager.ships.Count; i++)
        {
            if (GameManager.ships[i] != shooter && Vector3.Distance(torpedo.transform.position, GameManager.ships[i].transform.position) <= _detonationRange)
            {
                targets.Add(GameManager.ships[i]);
            }
        }

        if (targets.Count == 0)
        {
            return(false);
        }

        for (int i = 0; i < targets.Count; i++)
        {
            Vector3 hitpos = (torpedo.transform.position - targets[i].transform.position).normalized;

            base.SpawnShieldVFX(hitpos, hitpos * 5f, targets[i]);
            targets[i].ApplyDamage(GetDamage());
        }

        return(true);
    }
Пример #2
0
    /// <summary>
    /// 同步所有单位的属性
    /// </summary>
    private void SyncAllUnitAttr()
    {
        proto.S2CSyncUnitAttr attrList = new proto.S2CSyncUnitAttr();
        for (int i = 0; i < EntityManager.Instance.AttackUnitList.Count; ++i)
        {
            proto.UnitAttri attr   = new proto.UnitAttri();
            ShipEntity      entity = EntityManager.Instance.AttackUnitList[i] as ShipEntity;
            attr.unitid      = entity.ID;
            attr.durablility = entity.GetDurability();
            attr.armor       = entity.GetArmouredShield();
            attr.energy      = entity.GetEnergyShield();
            attrList.add_unitattrlist(attr);
        }

        for (int i = 0; i < EntityManager.Instance.DefenderUnitList.Count; ++i)
        {
            proto.UnitAttri attr   = new proto.UnitAttri();
            ShipEntity      entity = EntityManager.Instance.DefenderUnitList[i] as ShipEntity;
            attr.unitid      = entity.ID;
            attr.durablility = entity.GetDurability();
            attr.armor       = entity.GetArmouredShield();
            attr.energy      = entity.GetEnergyShield();
            attrList.add_unitattrlist(attr);
        }

        BattleSys.OnSyncUnitAttr(attrList);
    }
Пример #3
0
    static void OnSelectionBoxClose(Vector3 origin, Vector3 end)
    {
        Vector3 v1 = _camera.ScreenToViewportPoint(origin);
        Vector3 v2 = _camera.ScreenToViewportPoint(end);

        Vector3 min = Vector3.Min(v1, v2);
        Vector3 max = Vector3.Max(v1, v2);

        min.z = _camera.nearClipPlane;
        max.z = _camera.farClipPlane;

        Bounds bounds = new Bounds();

        bounds.SetMinMax(min, max);

        List <ShipEntity> ships = new List <ShipEntity>();

        for (int i = 0; i < GameManager.ships.Count; i++)
        {
            ShipEntity s = GameManager.ships[i];

            if (bounds.Contains(_camera.WorldToViewportPoint(s.transform.position)) && s.teamID == 0)
            {
                ships.Add(s);
            }
        }

        SelectShips(ships);
    }
Пример #4
0
    IEnumerator MoveProjectile(Vector3 start, ShipEntity target, bool hit)
    {
        GameObject projectile = Object.Instantiate(base.shotVFX, start, Quaternion.identity, null);
        Vector3    miss       = target.transform.position + Random.onUnitSphere * 10f;
        Vector3    hitpos     = target.transform.position + (base.owner.transform.position - target.transform.position).normalized * (2 + (int)target.ship.size);

        float d  = Vector3.Distance(start, target.transform.position);
        float tt = d / base.speed;
        float t  = 0f;

        while (t <= tt && target != null)
        {
            t += Time.deltaTime;

            hitpos = target.transform.position + (start - target.transform.position).normalized * (2 + (int)target.ship.size);
            projectile.transform.position = Vector3.Lerp(start, hit ? hitpos : miss, t / tt);
            projectile.transform.LookAt(hit ? target.transform.position : miss);
            yield return(null);
        }

        if (target != null)
        {
            if (hit)
            {
                base.SpawnShieldVFX(-projectile.transform.forward.normalized, hitpos, target);
                target.ApplyDamage(base.GetDamage());
            }
        }

        Object.Destroy(Object.Instantiate(detonationVFX, projectile.transform.position, Random.rotation, null), 3f);
        Object.Destroy(projectile);
    }
Пример #5
0
    // Start is called before the first frame update
    void Start()
    {
        if (!(shipEntity = FindObjectOfType <ShipEntity>()))
        {
            Debug.Log(this.GetType().Name + " have not found " + typeof(ShipEntity));
        }

        if (!(baseSystem = FindObjectOfType <BaseSystem>()))
        {
            Debug.Log(this.GetType().Name + " have not found " + typeof(BaseSystem));
        }

        if (!(timerManager = FindObjectOfType <TimerManager>()))
        {
            Debug.Log(this.GetType().Name + " have not found " + typeof(TimerManager));
        }

        if (shipEntity != null)
        {
            shipTransform = shipEntity.GetComponent <Transform>();
        }

        if (baseSystem != null)
        {
            baseTransform = baseSystem.GetComponent <Transform>();
        }

        healthPointSlider.maxValue = shipEntity.MaximalHealth;
        eachNitroPointRate         = (1.0f - (coverNitroPointRate * 2.0f)) / shipEntity.MaximalNitro;
        nitroPointImage.fillAmount = (eachNitroPointRate * shipEntity.MaximalNitro) + coverNitroPointRate;
        weightPointSlider.maxValue = shipEntity.MaximalWeight;
    }
Пример #6
0
    /// <summary>
    /// 单位被摧毁
    /// </summary>
    public void OnUnitDestory(ShipEntity entity)
    {
        if (entity.CampType == FightServiceDef.CampType.Camp_Attacker)
        {
            int refID = entity.Ship.Reference.id;
            if (LostUnitDict_.ContainsKey(entity.Ship.Reference.id))
            {
                LostUnitDict_[refID]++;
            }
            else
            {
                LostUnitDict_.Add(refID, 1);
            }

            if (entity.Ship.IsCommanderShip())
            {
                LostFlagShip_ = true;
            }

            LostUnitCount_++;
        }
        else
        {
            // 指挥中心的判断,Demo版本先用ID来判断
            if (entity.Ship.Reference.id == 60000)
            {
                DestoryHeadquarters_ = true;
            }
        }

        // TUDO  其他计算暂时不实现
    }
Пример #7
0
    public void Initialize(ShipEntity owner)
    {
        _owner      = owner;
        _visualizer = owner.GetComponentInChildren <Visualizer>();

        StartCooldown();
    }
Пример #8
0
    // 距离最近的敌人
    private static void GetClosestDefaultEnemy(ShipEntity caster, ClientSkill skill, ref List <ShipEntity> targetList)
    {
        float distSeq     = float.MaxValue;
        int   targetIndex = -1;

        for (int i = 0; i < EntityManager.Instance.DefenderUnitList.Count; ++i)
        {
            ShipEntity targetShip  = EntityManager.Instance.DefenderUnitList[i] as ShipEntity;
            int        seqDistance = (skill.Prop.cast_range + targetShip.Ship.Reference.vol) * (skill.Prop.cast_range + targetShip.Ship.Reference.vol);
            if (!IsInCricularSector2(skill.ControlPart, targetShip, seqDistance, skill.Prop.cast_angle))
            {
                continue;
            }
            float targetDistSeq = GetDistanceSq(caster.Ship, targetShip.Ship);
            if (targetDistSeq < distSeq)
            {
                distSeq     = targetDistSeq;
                targetIndex = i;
            }
        }

        if (targetIndex != -1)
        {
            targetList.Add(EntityManager.Instance.DefenderUnitList[targetIndex] as ShipEntity);
        }
    }
Пример #9
0
        public void InitializeShipMaterials(ShipEntity shipEntity, PSShip psShip)
        {
            Material material1 = Object.Instantiate(Resources.Load("HSBMaterial")) as Material;

            material1.SetFloat("_Hue", psShip.HueValue);
            material1.SetFloat("_Saturation", psShip.SaturationValue);
            material1.SetFloat("_Brightness", psShip.BrightnessValue);
            shipEntity.sharedMaterial = material1;
            ((Renderer)shipEntity.shipInterior.GetComponent <SpriteRenderer>()).set_material(shipEntity.sharedMaterial);
            ((Renderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).set_material(shipEntity.sharedMaterial);
            Material material2 = Object.Instantiate(Resources.Load("SpriteMask")) as Material;

            material2.SetFloat("_Hue", psShip.HueValue);
            material2.SetFloat("_Saturation", psShip.SaturationValue);
            material2.SetFloat("_Brightness", psShip.BrightnessValue);
            shipEntity.skinMaskMaterial = material2;
            ((Renderer)shipEntity.skinLayer.GetComponent <SpriteRenderer>()).set_material(shipEntity.skinMaskMaterial);
            Material material3 = Object.Instantiate(Resources.Load("BlendModeRamp")) as Material;

            material3.SetFloat("_Hue", psShip.HueValue);
            material3.SetFloat("_Saturation", psShip.SaturationValue);
            material3.SetFloat("_Brightness", psShip.BrightnessValue);
            shipEntity.skinMaterial = material3;
            ((Renderer)shipEntity.exteriorSkin.GetComponent <SpriteRenderer>()).set_material(shipEntity.skinMaterial);
        }
Пример #10
0
    private proto.PartFireInfo PartFire(ClientParts part, ShipEntity target)
    {
        proto.PartFireInfo fireInfo = new proto.PartFireInfo();
        fireInfo.targetid = target.ID;

        if (part.Reference.missle_vel > 0)
        {
            float distance   = Vector3.Distance(this.Ship.Position, target.Ship.Position);
            int   delayFrame = Mathf.CeilToInt(distance / (part.Reference.missle_vel * FightServiceDef.SPEED_SCALAR));
            fireInfo.delayframe = delayFrame;
        }
        else
        {
            int delayFrame = Mathf.CeilToInt(part.Reference.continued_time / FightServiceDef.FRAME_INTERVAL_TIME);
            fireInfo.delayframe = delayFrame;
        }

        int baseAtk = GetBaseAtkValue(part, target);

        if (Ship.Reference.stack)
        {
            baseAtk *= StackAliveNum_;
        }
        MessageDispatcher.Instance.DispatchMessage(TelegramType.UnderAttack, this.ID, target.ID, fireInfo.delayframe, baseAtk, part.Reference.effect_type);

        return(fireInfo);
    }
Пример #11
0
        public void SharedShipCreation(ShipEntity shipEntity, PSShip psShip, SimpleManager.GenericDelegate buttonDel)
        {
            this.AddShipButtonDelegate((EventTrigger)shipEntity.clickDetector.GetComponent <EventTrigger>(), buttonDel);
            this.InitializeShipSprites(shipEntity, psShip);
            shipEntity.CreateStickerEntities();
            shipEntity.UpdateFleetFlagIcon();
            this.InitializeShipMaterials(shipEntity, psShip);
            float num1 = 0.0f;
            float num2 = 0.0f;

            if (Object.op_Inequality((Object)((SpriteRenderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).get_sprite(), (Object)null))
            {
                Bounds bounds1 = ((SpriteRenderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).get_sprite().get_bounds();
                // ISSUE: explicit reference operation
                num1 = (float)((Bounds)@bounds1).get_size().x;
                Bounds bounds2 = ((SpriteRenderer)shipEntity.shipExterior.GetComponent <SpriteRenderer>()).get_sprite().get_bounds();
                // ISSUE: explicit reference operation
                num2 = (float)((Bounds)@bounds2).get_size().y;
            }
            if ((double)num1 > (double)num2)
            {
                TransformExtensions.ScaleByXY((Transform)shipEntity.exteriorSkin.GetComponent <RectTransform>(), 3.2f);
            }
            else
            {
                TransformExtensions.ScaleByXY((Transform)shipEntity.exteriorSkin.GetComponent <RectTransform>(), 3.5f);
            }
            ((Component)shipEntity).get_gameObject().SetActive(true);
        }
Пример #12
0
    IEnumerator MoveMissile(Vector3 start, ShipEntity target)
    {
        GameObject missile = Object.Instantiate(base.shotVFX, start, Quaternion.identity, null);

        float t = 0f;

        while (t <= _lifetime && target != null)
        {
            if (Vector3.Distance(missile.transform.position, target.transform.position) <= 1f)
            {
                Vector3 hitpos = (missile.transform.position - target.transform.position).normalized;
                base.SpawnShieldVFX(hitpos, hitpos * 5f, target);
                target.ApplyDamage(GetDamage());
                break;
            }

            t += Time.deltaTime;
            missile.transform.position = Vector3.Lerp(start, target.transform.position, t / _lifetime);
            missile.transform.LookAt(Vector3.Lerp(start, target.transform.position, (t + .1f) / _lifetime));
            yield return(null);
        }

        Object.Destroy(Object.Instantiate(base.detonationVFX, missile.transform.position, Random.rotation, null), 3f);
        Object.Destroy(missile);
    }
Пример #13
0
 public static void UpdateTarget(ShipEntity se)
 {
     for (int i = 0; i < _selectedShips.Count; i++)
     {
         _selectedShips[i].UpdateTarget(se);
     }
 }
Пример #14
0
 protected void SpawnShieldVFX(Vector3 shotBackwards, Vector3 hitpos, ShipEntity target)
 {
     if (target.GetVital(VitalType.ShieldPoints).current > 0f)
     {
         Object.Destroy(Object.Instantiate(ModelDB.GetShieldDeflectionVFX(), hitpos, Quaternion.LookRotation(shotBackwards), null), 3f);
     }
 }
Пример #15
0
    /// <summary>
    /// 执行技能
    /// </summary>
    /// <param name="skill"></param>
    /// <param name="targetID"></param>
    private void DoSkill(ClientSkill skill, int targetID, Vector3 position)
    {
        proto.UseSkill useSkill = new proto.UseSkill();
        useSkill.skillid    = skill.ID;
        useSkill.unitid     = this.ID;
        useSkill.partid     = skill.ControlPart.Id;
        useSkill.skillstage = Def.SkillStage.Casting;
        useSkill.posx       = (int)(position.x * 10000);
        useSkill.posy       = (int)(position.y * 10000);
        useSkill.posz       = (int)(position.z * 10000);
        FightMessageCache.Instance.AddMessage(useSkill);

        var targetList = TargetSelector.FindSkillTarget(this, skill, targetID, position);

        for (int i = 0; i < targetList.Count; ++i)
        {
            ShipEntity         target   = targetList[i];
            proto.PartFireInfo fireInfo = new proto.PartFireInfo();
            fireInfo.targetid   = target.ID;
            fireInfo.delayframe = skill.Prop.continued_time;
            if (skill.Prop.missle_vel > 0)
            {
                float distance = Vector3.Distance(this.Ship.Position, target.Ship.Position);
                fireInfo.delayframe = Mathf.CeilToInt(distance / (skill.Prop.missle_vel * FightServiceDef.SPEED_SCALAR));
            }
            useSkill.add_fireinfolist(fireInfo);

            // 给目标发一条被技能打击的消息
            MessageDispatcher.Instance.DispatchMessage(TelegramType.UnderSkillAttack, this.ID, target.ID, fireInfo.delayframe, skill.Prop.effect_val, skill.Prop.skill_effect_type);
        }
    }
Пример #16
0
    // Start is called before the first frame update
    void Start()
    {
        //HideDamageIndicator();

        VFX_Drill(false);
        VFX_Thrust(false);
        VFX_Healing(false);

        shipEntity = GetComponent <ShipEntity>();
        skillTree  = GetComponent <SkillTree>();

        baseSystem        = FindObjectOfType <BaseSystem>();
        inGameMenuManager = FindObjectOfType <InGameMenuManager>();

        playerCollision = GetComponent <BoxCollider>();
        playerRigidbody = GetComponent <Rigidbody>();
        playerTransform = GetComponent <Transform>();

        basePosition = FindObjectOfType <BaseSystem>().transform.position;

        //slowDrillToggle.isOn = (drillSpeed == DrillSpeed.slow) ? true : false;

        //drillerVibrationFrequencyParticleSystem.Stop();

        eachWeightAffectThrustRate = (thrustPower - minimalThrustPower) / shipEntity.MaximalWeight;
        ControlThrustPowerByWeightRate(); // The thrust power will follow current weight rate

        //heatAmount = GetComponent<HeatSystem>().getHeatAmount();
        //maxHeatAmount = GetComponent<HeatSystem>().getMaxHeatAmount();

        originalDragRate = playerRigidbody.drag;
    }
Пример #17
0
 public int CalcBuffEffect(ShipEntity shipEntity, int buffType)
 {
     switch (buffType)
     {
     //在此处添加方法与类型的对应关系
     default: return(0);
     }
 }
Пример #18
0
 // 获取全体目标
 private static void GetAllTarget(ShipEntity caster, List <Entity> entityList, ref List <ShipEntity> targetList)
 {
     for (int i = 0; i < entityList.Count; ++i)
     {
         ShipEntity targetEntity = entityList[i] as ShipEntity;
         targetList.Add(targetEntity);
     }
 }
Пример #19
0
    public static void saveShip(ShipEntity entity)
    {
        PlayerPrefs.SetString("TSSE[ShipEntity][" + entity.uniqueId + "]", shipToString(entity));
        PlayerPrefs.SetString("TSSEList[Item][" + entity.uniqueId + "]", ItemDefinitions.itemsToString(entity.items));

        //GameObject.Find("GameLogic").GetComponent<GameEventHandler>().printThing(
        //    "TSSEList[Item][" + entity.uniqueId + "]");
    }
Пример #20
0
    /// <summary>
    /// 球体碰撞检测---简易版
    /// </summary>
    /// <param name="srcEntity"></param>
    /// <param name="targetEntity"></param>
    /// <returns></returns>
    private static bool IsCollision(ShipEntity srcEntity, ShipEntity targetEntity)
    {
        int   radius     = (srcEntity.Ship.Reference.vol + targetEntity.Ship.Reference.vol - Collision_Adjust);
        int   radiusSQ   = radius * radius;
        float distanceSQ = (targetEntity.Ship.Position.x - srcEntity.Ship.Position.x) * (targetEntity.Ship.Position.x - srcEntity.Ship.Position.x) + (targetEntity.Ship.Position.z - srcEntity.Ship.Position.z) * (targetEntity.Ship.Position.z - srcEntity.Ship.Position.z);

        return(radiusSQ >= distanceSQ);
    }
Пример #21
0
    // Start is called before the first frame update
    void Start()
    {
        layerMask_player = LayerMask.GetMask("Player");

        shipEntity        = FindObjectOfType <ShipEntity>();
        finalKeyTransform = GetComponent <Transform>();
        finalKeyEvent     = FindObjectOfType <FinalKeyEvent>();
    }
Пример #22
0
    public static List <ShipEntity> FindSkillTarget(ShipEntity caster, ClientSkill skill, int targetID, Vector3 position)
    {
        List <ShipEntity> targetList = new List <ShipEntity>();

        if (skill.Prop.cast_target_type == Def.CastTargetType.Self)
        {
            // 针对自身
            targetList.Add(caster);
        }
        else if (skill.Prop.skill_select_type == Def.SkillSelectType.CastScope)
        {
            FilterSkillTargetByCastTargetType(caster, skill, ref targetList);

            if (skill.Prop.shape_type == Def.ShapeType.Circle && targetList.Count == 1)
            {
                // Shape为Circle的时候,为溅射伤害
                ShipEntity centerTarget = targetList[0];
                FilterAllInCircleSkillTarget(skill, centerTarget.Ship.Position, EntityManager.Instance.DefenderUnitList, ref targetList);
            }
        }
        else if (skill.Prop.skill_select_type == Def.SkillSelectType.PlayerSelect)
        {
            if (skill.Prop.shape_type == Def.ShapeType.Default)
            {
                // 选定一个目标来攻击
                ShipEntity targetEntity = EntityManager.Instance.GetEntityByID(targetID) as ShipEntity;
                if (targetEntity != null)
                {
                    targetList.Add(targetEntity);
                }
            }
            else if (skill.Prop.shape_type == Def.ShapeType.Circle)
            {
                int castTargetType = skill.Prop.cast_target_type;
                switch (castTargetType)
                {
                case Def.CastTargetType.BothSides:
                    FilterAllInCircleSkillTarget(skill, position, EntityManager.Instance.AttackUnitList, ref targetList);
                    FilterAllInCircleSkillTarget(skill, position, EntityManager.Instance.DefenderUnitList, ref targetList);
                    break;

                case Def.CastTargetType.Friend:
                    FilterAllInCircleSkillTarget(skill, position, EntityManager.Instance.AttackUnitList, ref targetList);
                    break;

                case Def.CastTargetType.Enemy:
                    FilterAllInCircleSkillTarget(skill, position, EntityManager.Instance.DefenderUnitList, ref targetList);
                    break;
                }
            }
        }
        else if (skill.Prop.skill_select_type == Def.SkillSelectType.NoSelection)
        {
            FilterSkillTargetByCastTargetType(caster, skill, ref targetList);
        }

        return(targetList);
    }
Пример #23
0
    public ShipEntity Instantiate(Vector3 position, Quaternion rotation, int teamID, bool isDiscovered)
    {
        GameObject s      = Object.Instantiate(_hull.model, position, rotation, null);
        ShipEntity entity = s.GetComponent <ShipEntity>();

        entity.Initialize(this, teamID, isDiscovered);

        return(entity);
    }
Пример #24
0
    static void OnDestroyed(ShipEntity s)
    {
        OnShipDestroyed?.Invoke(s);

        _ships.Remove(s);

        LogManager.getInstance.AddEntry(s.teamID == 0 ? "The <i><color=yellow>" + s.name + "</color></i> has been lost with all souls, Admiral." : "Hostile vessel, <i><color=yellow>" + s.name + "</color></i> has been destroyed.");
        UpdateGameStatus();
    }
Пример #25
0
    void OnTargetChanged(ShipEntity t)
    {
        _target = t;

        if (_target == null)
        {
            _targetVisualization.enabled = false;
        }
    }
Пример #26
0
Файл: Buff.cs Проект: LynnPi/OF
    public Buff(proto.BuffReference buffRef, ShipEntity shipEntity)
    {
        BeginTick  = FightTicker.Ticker;
        ShipEntity = shipEntity;
        Prop       = buffRef;
//            if( ShipEntity != null ){
//                 NowArmouredShield = ShipEntity.Ship.Reference.durability * (1 + ShipEntity.Ship.Reference.durability_growthrate * (ShipEntity.Ship.Level - 1));
//                 NowEnergyShield = ShipEntity.Ship.Reference.energy * (1 + ShipEntity.Ship.Reference.energy_growthrate * (ShipEntity.Ship.Level - 1));
//            }
    }
Пример #27
0
        public ActionResult GetSingleShip(ApiVersion version, int id)
        {
            ShipEntity shipItem = _shipRepository.GetSingle(id);

            if (shipItem == null)
            {
                return(NotFound());
            }

            return(Ok(ExpandSingleShipItem(shipItem, version)));
        }
Пример #28
0
        private dynamic ExpandSingleShipItem(ShipEntity shipItem, ApiVersion version)
        {
            var     links = GetLinks(shipItem.ShipId, version);
            ShipDto item  = _mapper.Map <ShipDto>(shipItem);

            var resourceToReturn = item.ToDynamic() as IDictionary <string, object>;

            resourceToReturn.Add("links", links);

            return(resourceToReturn);
        }
Пример #29
0
 private static void FilterAllInCircleSkillTarget(ClientSkill skill, Vector3 position, List <Entity> entityList, ref List <ShipEntity> targetList)
 {
     for (int i = 0; i < entityList.Count; ++i)
     {
         ShipEntity targetShip = entityList[i] as ShipEntity;
         if (IsInCircle(targetShip, skill.Prop.aoe_range + targetShip.Ship.Reference.vol, position.x, position.y, position.z))
         {
             targetList.Add(targetShip);
         }
     }
 }
Пример #30
0
 // 获取所有的建筑目标
 private static void GetAllTargetBuilding(ShipEntity caster, List <Entity> entityList, ref List <ShipEntity> targetList)
 {
     for (int i = 0; i < entityList.Count; ++i)
     {
         ShipEntity targetEntity = entityList[i] as ShipEntity;
         if (targetEntity.Ship.GetShipStrait() == Def.ShipTrait.Build)
         {
             targetList.Add(targetEntity);
         }
     }
 }