Beispiel #1
0
 private void ReleaseNormalAtk()
 {
     //PECommon.Log("Click Normal Atk");
     if (entitySelfPlayer.currentAniState == AniState.Attack)
     {
         //在500ms以内进行第二次点击,存数据
         double nowAtkTime = TimerSvc.Instance.GetNowTime();
         if (nowAtkTime - lastAtkTime < Constants.ComboSpace && lastAtkTime != 0)
         {
             if (comboArr[comboIndex] != comboArr[comboArr.Length - 1])
             {
                 comboIndex += 1;
                 entitySelfPlayer.comboQue.Enqueue(comboArr[comboIndex]);
                 lastAtkTime = nowAtkTime;
             }
             else
             {
                 lastAtkTime = 0;
                 comboIndex  = 0;
             }
         }
     }
     else if (entitySelfPlayer.currentAniState == AniState.Idle || entitySelfPlayer.currentAniState == AniState.Move)
     {
         comboIndex  = 0;
         lastAtkTime = TimerSvc.Instance.GetNowTime();
         entitySelfPlayer.Attack(comboArr[comboIndex]);
     }
 }
Beispiel #2
0
 public void ReleasNormalAttack()
 {
     if (entityPlayer.currentAnimState == AniState.Attack)
     {
         if (comboIdx < comboArr.Length - 1)
         {
             //500ms内进行点击,存数据
             double nowTime = timerSvc.GetNowTime();
             if (nowTime - lastAtkTime < Constants.ComboSpace && lastAtkTime != 0)
             {
                 entityPlayer.comboQue.Enqueue(comboArr[++comboIdx]);
                 lastAtkTime = nowTime;
             }
         }
         else
         {
             comboIdx    = 0;
             lastAtkTime = 0;
         }
     }
     else if (entityPlayer.currentAnimState == AniState.Idle || entityPlayer.currentAnimState == AniState.Move)
     {
         comboIdx    = 0;
         lastAtkTime = timerSvc.GetNowTime();
         entityPlayer.Attack(111);
     }
 }
Beispiel #3
0
 /// <summary>
 /// 普通攻击
 /// </summary>
 private void ReleaseNormalAtk()
 {
     if (entityPlayer._currentPlayerAniState == PlayerAniState.Attack)
     {
         double nowTime = TimerSvc.Instance.GetNowTime();
         if (nowTime - lastAtkTime < Constants.cComboInterval && lastAtkTime != 0)
         {
             if (comboIdx < comboDataArr.Length - 1)
             {
                 comboIdx++;
                 //comboIdx = comboIdx >= (comboDataArr.Length) ? 0 : comboIdx;
                 entityPlayer._comboQue.Enqueue(comboDataArr[comboIdx]);
                 lastAtkTime = nowTime;
             }
             else
             {
                 comboIdx    = 0;
                 lastAtkTime = 0;
             }
         }
     }
     else if (entityPlayer._currentPlayerAniState == PlayerAniState.Idle ||
              entityPlayer._currentPlayerAniState == PlayerAniState.Move)
     {
         comboIdx = 0;
         entityPlayer.Attack(comboDataArr[comboIdx]);
         lastAtkTime = TimerSvc.Instance.GetNowTime();
     }
 }
Beispiel #4
0
    private void ReleaseNormalAtk()
    {
        if (entityPlayer.currentAniState == AniState.Attack)
        {
            double curClickTime = TimerSvc.Instance.GetNowTime();
            //500ms内按下触发连招
            if (curClickTime - lastClickTime < Constant.interval && lastClickTime != 0)
            {
                //当combo数没有满时
                if (curComboIndex < comboArr.Length - 1)
                {
                    curComboIndex++;
                    entityPlayer.atkComboQue.Enqueue(comboArr[curComboIndex]);
                    lastClickTime = curClickTime;
                }
                //combo满时,重置连招
                else
                {
                    lastClickTime = 0;
                    curComboIndex = 0;
                }
            }
        }
        else if (entityPlayer.currentAniState == AniState.Idle || entityPlayer.currentAniState == AniState.Move)
        {
            lastClickTime = TimerSvc.Instance.GetNowTime();
            entityPlayer.Attack(Constant.Atk1ID);
        }

        //PECommon.Log("NormalAtk");
    }
Beispiel #5
0
 private void ReleaseNormalAtk()
 {
     //Debug.Log(GetType() + "/ReleaseNormalAtk()/ ");
     // 连招判定
     if (entityPlayer.currentAniState == AniState.Attack)
     {
         // 在规定时间内进行二次点击,存数据
         double nowAtkTime = TimerSvc.Instance.GetNowTime();
         if (nowAtkTime - lastAtkTime < Constants.ComboSpace && lastAtkTime != 0)
         {
             if (comboArr[comboIndex] != comboArr[comboArr.Length - 1])
             {
                 comboIndex += 1;
                 entityPlayer.comboQue.Enqueue(comboArr[comboIndex]);
                 lastAtkTime = nowAtkTime;
             }
             else
             {
                 lastAtkTime = 0;
                 comboIndex  = 0;
             }
         }
     }
     else if (entityPlayer.currentAniState == AniState.Idle ||
              entityPlayer.currentAniState == AniState.Move)
     {
         lastAtkTime = TimerSvc.Instance.GetNowTime();
         comboIndex  = 0;
         entityPlayer.Attack(comboArr[comboIndex]);
     }
 }
Beispiel #6
0
    private void ReleaseNormalAttack()
    {
        if (entityPlayer.curState == AnimState.Attack)
        {
            entityPlayer.Attack(comboAr[entityPlayer.nextCombo++], true);
        }
        else if (entityPlayer.curState == AnimState.Idle || entityPlayer.curState == AnimState.Move)
        {
            entityPlayer.nextCombo = 0;
            entityPlayer.Attack(comboAr[entityPlayer.nextCombo++], true);
        }
        if (entityPlayer.nextCombo >= comboAr.Length)
        {
            entityPlayer.nextCombo = 0;
        }
        #region //
        //if(entityPlayer.curState == AnimState.Attack)
        //{
        //    double nowAtkTime = TimerSev.Instance.GetMillisecondsTime();
        //    if(lastAtkTime != -1d && nowAtkTime - lastAtkTime < Constans.ComboSpace)
        //    {
        //        if(comboIndex >= comboAr.Length)
        //        {
        //            comboIndex = 0;
        //            lastAtkTime = -1d;
        //            entityPlayer.nextCombo = -1;
        //            return;
        //        }
        //        entityPlayer.nextCombo = comboAr[comboIndex++];
        //        //entityPlayer.comboQue.Enqueue(comboAr[comboIndex++]);
        //    }
        //    else entityPlayer.nextCombo = -1;

        //    lastAtkTime = nowAtkTime;
        //}
        //else if(entityPlayer.curState == AnimState.Idle || entityPlayer.curState == AnimState.Move)
        //{
        //    entityPlayer.nextCombo = -1;
        //    comboIndex = 0;
        //    entityPlayer.Attack(comboAr[comboIndex++]);
        //    lastAtkTime = TimerSev.Instance.GetMillisecondsTime();
        //}
        #endregion
    }
Beispiel #7
0
    //技能释放特效声音修改为特效出现时的audiosource组件播放
    #region 角色技能释放

    private void ReleaseNormalATK()
    {
        entitySelfPlayer.Attack(101);
    }
Beispiel #8
0
 private void ReleaseSkill1()
 {
     //PECommon.Log("Click Skill1");
     entitySelfPlayer.Attack(101);
 }
Beispiel #9
0
 public void ReleaseSkill1()
 {
     Debug.Log("1 skill");
     entitySelfPlayer.Attack(101);
 }