public void InitAIBaseByEnity(Enity enity) { this.enity = enity; selfType = enity.enityType; attackType = EnityManager.GetInstance().GetAttackEnityType(selfType); isCanMove = enity.enityType == EnityType.Hero; searchRadius = DataManager.instance.GetConfigValueToFloat("fight_search_radius"); moveSpeed = DataManager.instance.GetConfigValueToFloat("fight_move_speed"); moveAnimatorType = AnimatorAction.Run; animator = enity.gameObject.GetComponent <Animator>(); //////////////////////////判断是否装备武器/////////////////////////////////// Item equip = enity.GetEnityEquip(); if (equip != null) { aiWeapon = gameObject.AddComponent <AIWeapon>(); aiWeapon.InitWeaponByEquip(equip); } isInit = true; }