(client) feat:添加UI多线段绘制器,贝塞尔曲线绘制器及其编辑器, fix:单目标子弹在一帧内击中多个目标未被限制击中数量
This commit is contained in:
@ -36,7 +36,7 @@ namespace Entity
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
var entity = other.GetComponent<Entity>();
|
||||
if (!entity || entity == bulletSource || entity is Pickup) return;
|
||||
if (IsDead||!entity || entity == bulletSource || entity is Pickup) return;
|
||||
if (Managers.AffiliationManager.Instance.GetRelation(bulletSource.affiliation, entity.affiliation) != Relation.Friendly || Setting.Instance.CurrentSettings.friendlyFire)
|
||||
{
|
||||
entity.OnHit(this);
|
||||
|
@ -216,6 +216,7 @@ namespace Entity
|
||||
return;
|
||||
weaponItem=GameObjectCreate.SpriteAnimator(currentWeapon.Icon.ToArray(), weaponAnimator.transform);
|
||||
weaponItem.SetFPS(currentWeapon.FPS);
|
||||
weaponItem.gameObject.SetActive(true);
|
||||
|
||||
weaponAttackAnimation = GameObjectCreate.SpriteAnimator(currentWeapon.AttackAnimation.ToArray(),
|
||||
weaponAnimator.transform);
|
||||
@ -393,7 +394,7 @@ namespace Entity
|
||||
private void StartAttack(WeaponResource weaponResource)
|
||||
{
|
||||
_attackTimer = weaponResource.AttackCooldown;
|
||||
_attackDetectionTime = weaponResource.AttackDetectionTime;
|
||||
_attackDetectionTime =Mathf.Max(0,weaponResource.AttackCooldown- weaponResource.AttackDetectionTime);
|
||||
currentAttackWeapon = weaponResource;
|
||||
|
||||
if (weaponResource.AttackAnimationTime > 0)
|
||||
@ -594,8 +595,13 @@ namespace Entity
|
||||
{
|
||||
var mousePos = MousePosition.GetWorldPosition();
|
||||
attackDirection = new Vector3(mousePos.x,mousePos.y) - Position;
|
||||
RotateTool.RotateTransformToDirection(weaponItem.transform, attackDirection);
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.V))
|
||||
{
|
||||
weaponItem.gameObject.SetActive(!weaponItem.gameObject.activeSelf);
|
||||
}
|
||||
|
||||
// 获取当前键盘输入状态(2D 移动,只使用 X 和 Y 轴)
|
||||
var inputDirection = Vector2.zero;
|
||||
|
||||
|
Reference in New Issue
Block a user