Ejemplo n.º 1
0
    /// <summary>
    /// 向此快捷栏中添加技能
    /// </summary>
    /// <param name="id">技能id</param>
    public void SetThisGridShotCutById(int id)
    {
        this.id   = id;
        this.info = SkillsInfo.Instance().GetSkillInfoById(id);
        ShotCut shotCut = this.GetComponentInChildren <ShotCut>();

        shotCut.SetIconAndId(id, info.icon_name);
        shotCut.transform.localPosition = Vector3.zero;
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 设置当前技能信息
    /// </summary>
    /// <param name="id"></param>
    public void SetThisSkillById(int id)
    {
        this.id                = id;
        info                   = SkillsInfo.Instance().GetSkillInfoById(id);
        maxCD                  = info.cd;
        currentCD              = maxCD;
        icon.spriteName        = info.icon_name;
        skillDragController.id = id;
        string message = "";

        switch (info.skillType)
        {
        case SkillInfo.SkillType.Cure:            message = GetCureMessage();            break;

        case SkillInfo.SkillType.Buff:            message = GetBuffMessage();            break;

        case SkillInfo.SkillType.MultiTarget: message = GetMultiAttackMessage(); break;
        }
        infoText.text = message;
    }