角色类
设置角色类,在Scripts下新建MonoBehaviours文件夹,并将MovementController拖进去
在MonoBehaviours新建c#脚本,命名为Character,双击打开编辑
编写代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;public abstract class Character : MonoBehaviour
{// Start is called before the first frame updatepublic int hitPoints;public int maxHitPoints;
}
再新建一个Player类
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//继承Character
public class Player : Character
{}