4/10/2014

Project RPG BÀI 14B. DỌN DẸP FILE SKILL



Thêm chú thích và các công dụng để dễ hiểu rõ hơn phần nào về các tính năng của script Skill...


Double click vào file Skill và xóa tất cả đi, chèn lại đoạn code sau vào:

/// <summary>
/// Skill.cs
///
/// This class contain all the extra function that are needed for a skill
/// </summary>
public class Skill : ModifiedStat {
    private bool _known;            //a boolean variable to toggle if a character knowns a skill

    /// <summary>
    /// Initializes a new instance of the <see cref="Skill"/> class.
    /// </summary>
    public Skill(){
        UnityEngine.Debug.Log ("Skill created");
        _known = false;
        ExpToLevel = 25;
        LevelModifier = 1.1f;
    }

    /// <summary>
    /// Gets or sets a value indicating whether this <see cref="Skill"/> is known.
    /// </summary>
    /// <value><c>true</c> if known; otherwise, <c>false</c>.</value>
    public bool Known{
        get{ return _known; }
        set{ _known = value; }
    }
}

/// <summary>
/// This enumeration is just a list of skills the player can learn
/// </summary>
public enum SkillName{
    Melee_Offence,
    Melee_Defence,
    Ranged_Offence,
    Ranged_Defence,
    Magic_Offence,
    Magic_Defence
}

No comments:

Post a Comment