|
|
@@ -18,7 +18,6 @@ public class MoveCharacter : Character
|
|
|
|
|
|
[Header("组件")]
|
|
|
public Foot foot;
|
|
|
- private ScreenShake ss;
|
|
|
[HideInInspector]public AttributeStatus attributeStatus;
|
|
|
|
|
|
[Header("额外重力")]
|
|
|
@@ -118,7 +117,6 @@ public class MoveCharacter : Character
|
|
|
mesh = spinee.GetComponent<MeshRenderer>();
|
|
|
mats = mesh.materials;
|
|
|
origY = transform.position.y;
|
|
|
- ss = Camera.main.GetComponentInParent<ScreenShake>();
|
|
|
attributeStatus = GetComponent<AttributeStatus>();
|
|
|
}
|
|
|
|
|
|
@@ -161,17 +159,6 @@ public class MoveCharacter : Character
|
|
|
|
|
|
public void FloatStateOn()
|
|
|
{
|
|
|
- if (isInvisible)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (GetComponent<PlayerController>())
|
|
|
- {
|
|
|
- if (GetComponent<PlayerController>().isBaseBtnOut)
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
if (canMove)
|
|
|
{
|
|
|
canMove = false;
|
|
|
@@ -355,45 +342,7 @@ public class MoveCharacter : Character
|
|
|
//仅造成伤害
|
|
|
public override void BeHit(int damage)
|
|
|
{
|
|
|
- hp -= damage;
|
|
|
-
|
|
|
- //伤害跳字
|
|
|
- if (showInjuryNum)
|
|
|
- {
|
|
|
- GameObject injuryNum = Instantiate(injuryNumText);
|
|
|
- injuryNum.transform.position = new Vector3(transform.position.x + Random.Range(-1f, 1f), transform.position.y + 1, transform.position.z);
|
|
|
- TextMeshProUGUI text = injuryNum.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
- text.text = damage.ToString();
|
|
|
- if (gameObject.CompareTag("Player"))
|
|
|
- {
|
|
|
- text.color = Color.red;
|
|
|
- if (debugAttackFrom)
|
|
|
- {
|
|
|
- Debug.Log("主角受到" + damage.ToString() + "点伤害");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- uiHp.Show(hp, totalHp);
|
|
|
- if (hp <= 0)
|
|
|
- {
|
|
|
- ChangeState(CharacterState.Die);
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (gameObject.layer == 6) //屏幕红闪+抖动
|
|
|
- {
|
|
|
- if (ss == null)
|
|
|
- {
|
|
|
- ss = Camera.main.GetComponentInParent<ScreenShake>();
|
|
|
- }
|
|
|
- ss.enabled = true;
|
|
|
- if (isSustainedInjury || damage >= heavyDamage)
|
|
|
- {
|
|
|
- ss.HeavyShakeShine();
|
|
|
- }
|
|
|
- }
|
|
|
+ base.BeHit(damage);
|
|
|
}
|
|
|
|
|
|
//造成伤害附加其他效果
|
|
|
@@ -405,6 +354,10 @@ public class MoveCharacter : Character
|
|
|
{
|
|
|
switch (ae)
|
|
|
{
|
|
|
+ //漂浮
|
|
|
+ case AttackEffect.FloatState:
|
|
|
+ attributeStatus.AddFloat(attackInfo.floatState);
|
|
|
+ break;
|
|
|
//击飞
|
|
|
case AttackEffect.BlowUp:
|
|
|
attributeStatus.AddBlowUp(attackInfo.blowUp,dir);
|
|
|
@@ -460,19 +413,6 @@ public class MoveCharacter : Character
|
|
|
ChangeState(CharacterState.Die);
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- if (gameObject.layer == 6) //屏幕红闪+抖动
|
|
|
- {
|
|
|
- if (ss == null)
|
|
|
- {
|
|
|
- ss = Camera.main.GetComponentInParent<ScreenShake>();
|
|
|
- }
|
|
|
- ss.enabled = true;
|
|
|
- if (isSustainedInjury || damage >= heavyDamage)
|
|
|
- {
|
|
|
- ss.HeavyShakeShine();
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
//受到持续伤害
|