示例#1
0
        bool inTouch = false;          // 是否在触摸事件中

        public void Reset()
        {
            firstType = AttackFirstType.none;
            //preFirstType = AttackFirstType.none;
            touchStartTime = -1;
            isHold         = false;
            inTouch        = false;
        }
示例#2
0
 void FirstInstructFunc(AttackFirstType type)
 {
     if (type != AttackFirstType.none)
     {
         //preFirstType = firstType;
         firstType = type;
         DealAttackType();
     }
 }
示例#3
0
        //AttackSdType preAttackType = AttackSdType.none;
        //AttackFirstType preFirstType = AttackFirstType.none;
        //AttackSecondType preSecondType = AttackSecondType.none;

        public void Reset()
        {
            attackType = AttackSdType.none;
            firstType  = AttackFirstType.none;
            secondType = AttackSecondType.none;
            //preAttackType = AttackSdType.none;
            //preFirstType = AttackFirstType.none;
            //preSecondType = AttackSecondType.none;
        }
示例#4
0
 public void Update()
 {
     if (!inTouch)
     {
         return;
     }
     // 检测是否是Hold
     if (isHold == false && Time.time - touchStartTime >= minHoldTime)
     {
         isHold    = true;
         firstType = AttackFirstType.HA1;
         Notify();
     }
 }
示例#5
0
        public void OnTouchEnd()
        {
            inTouch = false;
            AttackFirstType tmpType = AttackFirstType.none;

            switch (firstType)
            {
            case AttackFirstType.A1:
                tmpType = AttackFirstType.AR1;
                Notify();
                break;

            case AttackFirstType.HA1:
                tmpType = AttackFirstType.HAR1;
                break;
            }
            SetFirstType(tmpType);
            Notify();
            Reset();
        }
示例#6
0
 public void SetFirstType(AttackFirstType type)
 {
     //preFirstType = firstType;
     firstType = type;
 }
示例#7
0
        AttackSdType GetAttackTypeByFirstAndSecond(AttackFirstType firstType, AttackSecondType secondType)
        {
            AttackSdType attackType = AttackSdType.none;

            switch (firstType)
            {
            case AttackFirstType.A1:
                switch (secondType)
                {
                case AttackSecondType.N2:
                    attackType = AttackSdType.A;
                    break;

                case AttackSecondType.U2:
                    attackType = AttackSdType.AU;
                    break;

                case AttackSecondType.D2:
                    attackType = AttackSdType.AD;
                    break;

                case AttackSecondType.L2:
                    attackType = AttackSdType.AL;
                    break;

                case AttackSecondType.R2:
                    attackType = AttackSdType.AR;
                    break;
                }
                break;

            case AttackFirstType.HA1:
                switch (secondType)
                {
                case AttackSecondType.N2:
                    attackType = AttackSdType.HA;
                    break;

                case AttackSecondType.U2:
                    attackType = AttackSdType.HAU;
                    break;

                case AttackSecondType.D2:
                    attackType = AttackSdType.HAD;
                    break;

                case AttackSecondType.L2:
                    attackType = AttackSdType.HAL;
                    break;

                case AttackSecondType.R2:
                    attackType = AttackSdType.HAR;
                    break;
                }
                break;

            case AttackFirstType.AR1:
                switch (secondType)
                {
                case AttackSecondType.NR2:
                    attackType = AttackSdType.ARN;
                    break;

                case AttackSecondType.UR2:
                    attackType = AttackSdType.ARU;
                    break;

                case AttackSecondType.DR2:
                    attackType = AttackSdType.ARD;
                    break;

                case AttackSecondType.LR2:
                    attackType = AttackSdType.ARL;
                    break;

                case AttackSecondType.RR2:
                    attackType = AttackSdType.ARR;
                    break;
                }
                break;

            case AttackFirstType.HAR1:
                switch (secondType)
                {
                case AttackSecondType.NR2:
                    attackType = AttackSdType.HARN;
                    break;

                case AttackSecondType.UR2:
                    attackType = AttackSdType.HARU;
                    break;

                case AttackSecondType.DR2:
                    attackType = AttackSdType.HARD;
                    break;

                case AttackSecondType.LR2:
                    attackType = AttackSdType.HARL;
                    break;

                case AttackSecondType.RR2:
                    attackType = AttackSdType.HARR;
                    break;
                }
                break;
            }
            return(attackType);
        }