//查找角色 private void Awake() { //整个项目中只有这样一个类型可以这么找 joystick = FindObjectOfType <ETCJoystick>(); moter = GetComponent <CharacterMotor>(); playersStatus = GetComponent <PlayerStatus>(); animator = GetComponentInChildren <Animator>(); etcButtons = FindObjectsOfType <ETCButton>(); playerSkills = GetComponent <CharacterSkillManager>(); skillSystem = GetComponent <CharacterSkillSystem>(); }
/// <summary> /// 初始化字段:复杂类型【自定义类型】的字段 /// </summary> private void Start() { chMotor = GetComponent <CharacterMotor>(); chSkillSys = GetComponent <CharacterSkillSystem>(); RestMouse(); }