private void bulletHit() { bool needAttack = false; if (_scene.isDriveAll()) { needAttack = true; } else { //客户端驱动 if (_data.isInitiative) { CUnitBulletHitRequest.create(_unit.instanceID, _data.id, _data.level, _data.targetData).send(); } else { if (_unit.isSelfDriveAttackHapen()) { needAttack = true; } } } if (needAttack) { if (_config.attackID > 0) { _unit.fight.createAndExecuteAttack(_config.attackID, _data.level, _data.targetData); } } }
/// <summary> /// 创建实例 /// </summary> public static CUnitBulletHitRequest create(int instanceID, int bulletID, int bulletLevel, SkillTargetData target) { CUnitBulletHitRequest re = (CUnitBulletHitRequest)BytesControl.createRequest(dataID); re.instanceID = instanceID; re.bulletID = bulletID; re.bulletLevel = bulletLevel; re.target = target; return(re); }