public override bool AttackCollision(Bullet bullet, ref MessageManager msg) { //是否存在判定成功的情况 bool result = false; //对每一个组件都进行目标判定,并获得反馈结果 foreach (CollisionComponent c in AttackComponents) { if( c.Collision(bullet, ref msg)) result = true; } return result; }
//发生了擦弹(随机向周围发出爆炸粒子) public void MissBullet(Bullet b) { }
/// <summary> /// 对子弹的技能判定 /// </summary> /// <param name="bullet">判定的子弹对象</param> /// <param name="msg">返回的判定信息</param> /// <returns>是否进入判定域</returns> public virtual bool AttackCollision(Bullet bullet, ref MessageManager msg) { return false; }
public bool AttackCollision(Bullet bullet, ref MessageManager msg) { return CurrentCharactor.AttackCollision(bullet, ref msg); }