示例#1
0
    public bool IsShowOut()
    {
        //if (!IsShowing) return false;


        if (YinShenType == 2)
        {
            ShowYinShenTX();



            _db.animation.Stop();
            _gameBody.GetStand();
            _aiAirBase.ZhuanXiang();
            IsShowing            = false;
            _roledate.isCanBeHit = true;
            return(true);
        }



        //print("隐身后 显示 show!!!!");


        if (!_db.animation.HasAnimation(ShowACName))
        {
            IsShowing = false;
            //_roledate.isCanBeHit = true;
            ShowEnd();
            print("  没有显示动作  隐身流程走完!!!!  ");
            return(true);
        }

        //print(1);

        if (_db.animation.lastAnimationName == ShowACName && _db.animation.isCompleted)
        {
            IsShowing = false;

            //print(2);

            ShowEnd();
            print("     ----->  隐身 显示 完成!!!!!");
            return(true);
        }

        if (_db.animation.lastAnimationName != ShowACName)
        {
            _gameBody.GetAcMsg(ShowACName);
            //最好是在 动作里面做短
            _gameBody.SetACPlayScale(showACSpeed);
        }
        return(false);
    }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        if (_isGetOver)
        {
            return;
        }
        if (_roleDate.isDie || _roleDate.isBeHiting)
        {
            ReSetAll();
            TheSkillOver();
            DieOrBehit();
            _isGetOver = true;
            //_gameBody.GetPlayerRigidbody2D().velocity = Vector2.zero;
            print(this.name + "    ----over !!! ");

            return;
        }

        ChongqiOver();

        if (_player == null)
        {
            _player = GlobalTools.FindObjByName("player");
        }

        if (_player == null)
        {
            return;
        }

        if (IsCanZhuanxiang && AtkDistances != 0 && !IsInAtkDistances)
        {
            if (GetComponent <AIAirBase>())
            {
                //print("金利来的 是 空中的吗?????");
                //if (GetComponent<AIAirBase>().NearRoleInDistance(AtkDistances))
                //{
                //    if (!IsInAtkDistances)
                //    {
                //        IsInAtkDistances = true;
                //        GetComponent<AIBase>().ZhuanXiang();
                //    }
                //}

                if (GetComponent <AIAirRunNear>().ZhijieMoveToPoint(_player.transform.position, AtkDistances, 0.5f))
                {
                    if (!IsInAtkDistances)
                    {
                        IsInAtkDistances = true;
                        GetComponent <AIBase>().ZhuanXiang();
                    }
                }
            }
            else
            {
                print(" rzb    " + AtkDistances);

                if (GetComponent <AIBase>() && GetComponent <AIBase>().NearRoleInDistance(AtkDistances))
                {
                    if (!IsInAtkDistances)
                    {
                        IsInAtkDistances = true;
                        CQJishiNums      = 0;
                        GetComponent <AIBase>().ZhuanXiang();
                    }
                }
            }
        }
        else
        {
            if (!IsZhuangxiang)
            {
                IsZhuangxiang = true;
                CQJishiNums   = 0;
                if (IsCanZhuanxiang)
                {
                    GetComponent <AIBase>().ZhuanXiang();
                }
                //这里 要 特别 注意 很多 怪不能动 就是这里 导致的  GetStand 会ResetAll(); **** 注意处理  不能动 就  -->> IsResetInStand = false
                if (IsResetInStand)
                {
                    _gameBody.GetStand();
                }
                //if (GetComponent<AIBase>().thePlayer.transform.position.x > this.gameObject.transform.position.x)
                //{
                //    GetComponent<GameBody>().TurnRight();
                //}
                //else
                //{
                //    GetComponent<GameBody>().TurnLeft();
                //}
                print("?????zhuanxiang  stand!!!");
            }
            print("  ----> SkillStarting!!!");
            SkillStarting();
        }
    }