示例#1
0
    public void UseSkill(int idx)
    {
        PetData    data  = DataManager.GetInstance().GetSelectedPetData(idx);
        SkillTable skill = DataManager.GetInstance().GetSkillTable(data.activeSkillType);

        bActingSkill = true;

        UseSkillPopup popup = PopupSystem.GetPopup <UseSkillPopup>(Define.PopupType.UseSkill);

        popup.SetData(data, () =>
        {
            skillData[idx].nowCooltime = 0;
            skillData[idx].useSkillCount++;
            scoreAssistance.SetSkillPointMode();

            nowUseSkill = skill.skillType;

            switch (skill.skillType)
            {
            case Define.SkillType.StopTime:
                gameTimeAssistance.FreezeTime(skill.GetSkillValue(data.aSkillLv));
                AfterUseSkill();
                break;

            case Define.SkillType.BrokenTiles:
                mapAssistance.AllBlocksDown(AfterUseSkill);
                break;

            case Define.SkillType.ClearAllTiles:
                mapAssistance.ClearAllBlocks(AfterUseSkill);
                break;

            case Define.SkillType.DoubleScore:
                scoreAssistance.SetMultiBonus(
                    DataManager.GetDesignValue(Define.GameDesign.DoubleSkillScoreBonus),
                    skill.GetSkillValue(data.aSkillLv)
                    );
                AfterUseSkill();
                break;

            case Define.SkillType.FillLines:
                mapAssistance.ChangeTileTypeToFillLines(idx, AfterUseSkill);
                break;

            case Define.SkillType.ChangePuzzles:
                mapAssistance.ChangeAllPuzzles(AfterUseSkill);
                break;

            default:
                Debug.Log("something is wrong");
                AfterUseSkill();
                break;
            }
        });
        PopupSystem.OpenPopup(Define.PopupType.UseSkill);
    }
示例#2
0
    private void SettingUI(SkillPack skillPack, bool noCooltime, bool noValue, int skillLv)
    {
        skillPack.skillLevelLabel.text = GetSkillLevel(skillLv);

        if (!noCooltime && !noValue)
        {
            skillPack.skillLevelObject.localPosition = new Vector3(0f, doubleLevelHeight, 0f);
            skillPack.cooltimeObject.gameObject.SetActive(true);
            skillPack.cooltimeObject.localPosition = new Vector3(0f, -doubleSkillHeight, 0f);
            skillPack.valueObject.gameObject.SetActive(true);
            skillPack.valueObject.localPosition = new Vector3(0f, doubleSkillHeight, 0f);
            skillPack.cooltimeLabel.text        = skillData.GetSkillCoolTime(skillLv).ToString();
            skillPack.valueLabel.text           = skillData.GetSkillValue(skillLv).ToString();
            skillPack.background.height         = doubleBackHeight;
        }
        else if (noCooltime)
        {
            skillPack.skillLevelObject.localPosition = new Vector3(0f, singleLevelHeight, 0f);
            skillPack.cooltimeObject.gameObject.SetActive(false);
            skillPack.valueObject.gameObject.SetActive(true);
            skillPack.valueObject.localPosition = new Vector3(0f, singleSkillHeight, 0f);
            skillPack.valueLabel.text           = skillData.GetSkillValue(skillLv).ToString();
            skillPack.background.height         = singleBackHeight;
        }
        else if (noValue)
        {
            skillPack.skillLevelObject.localPosition = new Vector3(0f, singleLevelHeight, 0f);
            skillPack.valueObject.gameObject.SetActive(false);
            skillPack.cooltimeObject.gameObject.SetActive(true);
            skillPack.cooltimeObject.localPosition = new Vector3(0f, singleSkillHeight, 0f);
            skillPack.cooltimeLabel.text           = skillData.GetSkillCoolTime(skillLv).ToString();
            skillPack.background.height            = singleBackHeight;
        }
        else
        {
            Debug.Log("something is wrong");
        }
    }