️ 步调: 1.靠近武器,碰撞检测
2.将武器位置于坦克发射位置重合
3.武器中封装了发射方法
4.发射方法中封装了炮弹实例化而且发射的逻辑 坦克基类的封装
[code]using System.Collections;using System.Collections.Generic;using UnityEngine;//-------------------------------------//—————————————————————————————————————//___________项目: //___________功能: 坦克基类——会合子类雷同点//___________创建者:______秩沅______//___________________________________//-------------------------------------public abstract class TankFather : MonoBehaviour{ //攻击和防御相关 public int attack; public int defence; public int nowBlood; public int maxBlood; //移动和转速相关 public int moveSpeed; public int RotateSpeed; public int HeadSpeed; public Transform Head; //击败殊效 public GameObject diedEffect; //受伤举动 public virtual void Heart(TankFather other) { //当攻击力大于防御力时才生效 if (other.attack - defence > 0) { nowBlood -= (other.attack - defence); } if(nowBlood