123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- namespace FSRole {
- /*
- * 角色组件
- */
- public class Role : MonoBehaviour {
- // 角色原始属性
- public RoleAttr OriginAttr {
- set;
- get;
- }
- // 角色当前属性
- public RoleAttr CurrentAttr {
- set;
- get;
- }
- // Use this for initialization
- void Start() {
- }
- // Update is called once per frame
- void Update() {
- }
- /*
- * 添加角色的各个接口
- */
- /*
- * 受到伤害
- */
- public void GetDamage(int value) {
- CurrentAttr.Hp -= value;
- print("受到伤害");
- }
- /*
- * 消耗精力
- */
- public void CostEngine(int value) {
- CurrentAttr.Mp -= value;
- print("消耗精力");
- }
- /*
- * 增加防御力
- */
- public void Defense(int value) {
- CurrentAttr.Def += value;
- print("防御");
- }
- }
- }
|