示例#1
0
 public void GetStart(GameObject obj)
 {
     //_theTimer.ContinuouslyTimesAdd(Hxtimes,1,callBack);
     //_theTimer.GetContinuouslyTimesStart();
     isStarting = true;
     //特效播放
     HuixueTX.Play();
     //持续动作
     GetHXAC();
     _roleDate.addYZ(10000);
     if (SkillAudio)
     {
         SkillAudio.Play();
     }
     IsStartHuixue = true;
 }
示例#2
0
    public void GetStart(GameObject gameObj)
    {
        //判断 前面距离
        Vector2 start;
        //前面的距离测试
        Vector2 end;

        //print("ZSyishanZSys -1");
        jishiNums = 0;
        _XZtimes  = 0;
        if (this.transform.localScale.x < 0)
        {
            start = this.transform.position;
            end   = new Vector2(start.x + atkDistance + 2, start.y);
            Debug.DrawLine(start, end, Color.yellow);
            if (Physics2D.Linecast(start, end, _gameBody.groundLayer))
            {
                //Time.timeScale = 0;
                //print("撞墙 右!!!");
                GetOver();
                return;
            }
        }
        else
        {
            start = this.transform.position;
            end   = new Vector2(start.x - atkDistance - 2, start.y);
            Debug.DrawLine(start, end, Color.yellow);
            if (Physics2D.Linecast(start, end, _gameBody.groundLayer))
            {
                //Time.timeScale = 0;
                //print("撞墙 左!!!");
                GetOver();
                return;
            }
        }
        //print("ZSyishanZSys -2");
        if (isStart)
        {
            return;
        }


        //print("ZSyishanZSys -3");



        if (!isStart)
        {
            isStart = true;
        }
        //检测是否有悬崖 会冲出去    判断是否动作名是空    判断是否有需要的动作
        if (IsGetOutLand() || acName == "" || !_gameBody.IsHanAC(acName))
        {
            //print("ZSyishanZSys -4");
            GetOver();
            return;
        }

        //print("ZSyishanZSys -5");
        if (addYZNum != 0)
        {
            _roleDate.addYZ(addYZNum);
        }

        if (!DBBody)
        {
            DBBody = _gameBody.GetDB();
        }

        if (isFirstAddListener)
        {
            isFirstAddListener = false;
            DBBody.AddDBEventListener(DragonBones.EventObject.FRAME_EVENT, this.ShowACTX2);
        }

        //print("ZSyishanZSys -6");

        //摆出动作
        if (DBBody.animation.HasAnimation(acName))
        {
            //_gameBody.GetACByName(acName, true);
            _gameBody._isHasAtkTX = true;
            //_gameBody.GetAcMsg(acName);
            _gameBody.GetDB().animation.GotoAndPlayByFrame(acName, 0, 1);
            _gameBody.isAcing = true;

            if (Audio_YishanQishou)
            {
                Audio_YishanQishou.Play();
            }
        }
        //print("ZSyishanZSys -7");

        //停顿时间
        _gameBody.GetPause(StartZSStopTimes, pauseNums);
    }