|
|
@@ -166,13 +166,13 @@ public class AttributeStatus : MonoBehaviour
|
|
|
break;
|
|
|
//击飞
|
|
|
case AttackEffect.BlowUp:
|
|
|
- AddBlowUp(attackInfo.blowUp, attackFrom.bodyTrans.localScale.x < 0 ? -1 : 1);
|
|
|
+ AddBlowUp(attackInfo.blowUp, attackFrom.bodyTrans);
|
|
|
//虾兵特殊攻击先留着
|
|
|
//AddBlowUp(attackInfo.blowUp, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
|
|
|
break;
|
|
|
//击落
|
|
|
case AttackEffect.ShotDown:
|
|
|
- AddShotDown(attackInfo.shotDown, attackFrom.bodyTrans.localScale.x < 0 ? -1 : 1);
|
|
|
+ AddShotDown(attackInfo.shotDown, attackFrom.bodyTrans);
|
|
|
//虾兵特殊攻击先留着
|
|
|
//AddShotDown(attackInfo.shotDown, attackFrom.transform.position.x < character.transform.position.x ? -1 : 1);
|
|
|
break;
|
|
|
@@ -362,11 +362,21 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//受到击飞
|
|
|
- public void AddBlowUp(AttackInfo.BlowUp blowUp, float dir)
|
|
|
+ public void AddBlowUp(AttackInfo.BlowUp blowUp, Transform attackFrom)
|
|
|
{
|
|
|
attributeTime = blowUp.time * (1 - resistances.BlowUp);
|
|
|
Vector3 vec3 = blowUp.dir.normalized;
|
|
|
- if (dir < 0)
|
|
|
+ int attackDir = 0;
|
|
|
+ switch (blowUp.directionType)
|
|
|
+ {
|
|
|
+ case AttackInfo.BlowUp.DirectionType.Common:
|
|
|
+ attackDir = attackFrom.localScale.x < 0 ? -1 : 1;
|
|
|
+ break;
|
|
|
+ case AttackInfo.BlowUp.DirectionType.Spread:
|
|
|
+ attackDir = attackFrom.position.x < transform.position.x ? -1 : 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (attackDir < 0)
|
|
|
{
|
|
|
vec3.x = -vec3.x;
|
|
|
}
|
|
|
@@ -382,11 +392,21 @@ public class AttributeStatus : MonoBehaviour
|
|
|
}
|
|
|
|
|
|
//受到击落
|
|
|
- public void AddShotDown(AttackInfo.ShotDown shotDown, float dir)
|
|
|
+ public void AddShotDown(AttackInfo.ShotDown shotDown, Transform attackFrom)
|
|
|
{
|
|
|
attributeTime = shotDown.time * (1 - resistances.ShotDown);
|
|
|
Vector3 vec3 = shotDown.dir.normalized;
|
|
|
- if (dir < 0)
|
|
|
+ int attackDir = 0;
|
|
|
+ switch (shotDown.directionType)
|
|
|
+ {
|
|
|
+ case AttackInfo.ShotDown.DirectionType.Common:
|
|
|
+ attackDir = attackFrom.localScale.x < 0 ? -1 : 1;
|
|
|
+ break;
|
|
|
+ case AttackInfo.ShotDown.DirectionType.Spread:
|
|
|
+ attackDir = attackFrom.position.x < transform.position.x ? -1 : 1;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (attackDir < 0)
|
|
|
{
|
|
|
vec3.x = -vec3.x;
|
|
|
}
|