示例#1
0
    void ExecuteSkill(int skillId, int WhichBtn)
    {
        float cool;

        switch (skillId)
        {
        case 0:
            mySkillList.Repair();
            cool = mySkillList.cool0;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }

            break;

        case 1:
            mySkillList.Booster();
            cool = mySkillList.cool1;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 2:
            mySkillList.Shield();

            cool = mySkillList.cool2;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 3:
            mySkillList.Drone();
            cool = mySkillList.cool3;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 4:
            mySkillList.Balloon();
            cool = mySkillList.cool4;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 5:
            mySkillList.Rain();
            cool = mySkillList.cool5;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 6:
            mySkillList.SpeedCloud();
            cool = mySkillList.cool6;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 7:
            mySkillList.Thunder();
            cool = mySkillList.cool7;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 8:
            mySkillList.Anchor();
            cool = mySkillList.cool8;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 9:
            mySkillList.WaterBomb();
            cool = mySkillList.cool9;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        case 10:
            mySkillList.Chain();
            cool = mySkillList.cool10;
            if (WhichBtn == 1)
            {
                coolTime1 = cool;
                timer1On  = true;
            }
            else if (WhichBtn == 2)
            {
                coolTime2 = cool;
                timer2On  = true;
            }
            else
            {
                coolTime3 = cool;
                timer3On  = true;
            }
            break;

        default:
            Debug.Log("해당하는 스킬 없음");
            break;
        }
    }