Exemple #1
0
 //定位目标
 protected virtual bool GetNearTarget()
 {
     print("鱼 冲击 接近目标----------------  接近 ");
     if (this.transform.position.x > _targetObj.position.x)
     {
         //print("目标在左侧!!!  "+this.transform.position.x+"    -------x    "+ _targetObj.position.x);
         _airGameBody.TurnLeft();
     }
     else
     {
         //print("目标在---右侧!!!");
         _airGameBody.TurnRight();
     }
     return(runNear.Zhuiji(_atkDistance, false));
 }
Exemple #2
0
    void GoToNewPoint()
    {
        //print("距离--------------------------->    "+ (_targetObj.transform.position - this.transform.position).sqrMagnitude);
        //进入2点攻击距离
        if (_targetObj == null)
        {
            return;
        }
        //判断是否 进入 射程  两点间距离是否小于 distance
        if (!_pointDistration.IsTwoPointInDistance(_targetObj.transform.position, this.transform.position, AtkDistance))
        {
            if (IsGoToNewPoint)
            {
                //print(" new Point 坐标寻路 ");
                _runNear.ZhuijiZuoBiao(newPoint, AtkDistance);
            }
            else
            {
                //print(" new Point -------------------------------------------->    "+ AtkDistance);
                _runNear.Zhuiji(AtkDistance);
            }
            return;
        }

        _runNear.ZJStop();

        //判断Y距离 Y距离要达到攻击范围
        if (!_pointDistration.IsTwoPointInDistanceY(_targetObj.transform.position, this.transform.position, InDistanceY))
        {
            _runNear.GetMoveNearY(InDistanceY);
            //如果Y碰撞
            if (_runAway.IsHitTop || _runAway.IsHitDown)
            {
                _isBehaviorOver = true;
                _isStart        = false;
            }

            return;
        }
        IsFindRoading  = false;
        IsGoToNewPoint = false;
        IsGetFireTest  = true;
    }