示例#1
0
    public void GetStart(GameObject obj)
    {
        EnemyObj = obj;

        //提高硬值
        if (!isAcing)
        {
            isAcing = true;
            GetComponent <RoleDate>().addYZ(addYZNum);
            gameBody = GetComponent <GameBody>();
            _aiBase  = GetComponent <AIBase>();

            if (RunName == "" || !gameBody.GetDB().animation.HasAnimation(RunName) || !gameBody.GetDB().animation.HasAnimation(AtkName))
            {
                AcOver();
                return;
            }
            oldRunName   = gameBody.GetRunName();
            oldRunSpeedX = gameBody.maxSpeedX;
            //print("---------------->AtkName    " + AtkName + "   RunName  " + RunName+ "     oldRunName  "+ oldRunName);

            gameBody.RunACChange(RunName, moveSpeedX);

            if (AudioRunCut)
            {
                AudioRunCut.Play();
            }
        }
    }
示例#2
0
 void AcOver()
 {
     if (isAcing)
     {
         isAcing   = false;
         isAtking  = false;
         isRunNear = false;
         GetComponent <RoleDate>().hfYZ(addYZNum);
         gameBody.RunACChange(oldRunName, oldRunSpeedX);
         GetComponent <GameBody>().isAcing = false;
     }
 }
示例#3
0
 //奔跑动作 和 速度 还原
 void RunAndSpeedHY()
 {
     _gameBody.RunACChange(_ysRunName, _ysRunSpeed);
 }
示例#4
0
    void ChongjiBegin()
    {
        if (!IsChongjiHX2Start)
        {
            return;
        }

        if (_roledate.isBeHiting || _roledate.isDie || _gameBody.IsGround || _gameBody.IsHitWall)
        {
            ReSetAll();
            IsChongjiOver = true;
            return;
        }

        if (IsChongjiOver)
        {
            return;
        }
        if (isStartChongji)
        {
            _gameBody.isAcing = true;
            if (!IsInStartAC)
            {
                IsInStartAC       = true;
                _gameBody.isAcing = true;

                _gameBody.RunACChange(CJ_Start);
                _gameBody.GetDB().animation.FadeIn(CJ_Start, 0.2f);
                //_gameBody.GetDB().animation.GotoAndPlayByTime(CJ_Start, 0);
                //print("  进入 飞行 冲击动作  "+ CJ_Start+"   是否包含该动作 "+ _gameBody.GetDB().animation.HasAnimation(CJ_Start)+"    当前动作???  "+ _gameBody.GetDB().animation.lastAnimationName);

                Lizi_Huoyan.Play();
                ChongJiHitKuai.SetActive(true);
                SelfHitKuai.SetActive(false);

                //伤害变动
                GetComponent <JN_Date>().atkPower = ChongjiShanghai;
            }

            if (!IsToEnd && GetComponent <AIAirRunNear>().ZhijieMoveToPoint(TargetPos, 1, MinSpeed, false, true, MaxSpeed))
            {
                IsToEnd = true;
                //还原到 站立动作
                _gameBody.RunACChange(MoRenRunACName);
                print(" 还原的 跑动动作是啥?????????MoRenRunACName    " + MoRenRunACName);
                _gameBody.isAcing = false;

                _gameBody.GetAcMsg(_gameBody.GetStandACName());
                ReSetAll();
                IsChongjiOver = true;
            }

            if (!_gameBody.isAcing)
            {
                ReSetAll();
                IsChongjiOver = true;
            }

            return;
        }

        if (_gameBody.GetDB().animation.lastAnimationName == CJ_Begin && !_gameBody.isAcing)
        {
            isStartChongji = true;
        }
    }