|
@@ -90,24 +90,18 @@ public class MoveCharacter : Character
|
|
|
|
|
|
|
|
[Header("冰冻效果")]
|
|
[Header("冰冻效果")]
|
|
|
public bool isFrozen = false;
|
|
public bool isFrozen = false;
|
|
|
- //public float frozenTime;
|
|
|
|
|
private float frozenTimer;
|
|
private float frozenTimer;
|
|
|
|
|
|
|
|
[Header("感电效果")]
|
|
[Header("感电效果")]
|
|
|
- public float electrifyAttackSpeedScale = 0.6f;
|
|
|
|
|
- public float electrifyMoveSpeedScale = 0.6f;
|
|
|
|
|
public bool isElectrify = false;
|
|
public bool isElectrify = false;
|
|
|
- //public float electrifyTime;
|
|
|
|
|
private float electrifyTimer;
|
|
private float electrifyTimer;
|
|
|
- private GameObject electrifyEffect;
|
|
|
|
|
|
|
+ public GameObject electrifyEffect;
|
|
|
|
|
|
|
|
[Header("灼烧效果")]
|
|
[Header("灼烧效果")]
|
|
|
public bool isOnFire = false;
|
|
public bool isOnFire = false;
|
|
|
public int fireStacks;
|
|
public int fireStacks;
|
|
|
private float fireTimer;
|
|
private float fireTimer;
|
|
|
- //public float firerInterval = 0.5f;
|
|
|
|
|
private float fireBuffTimer;
|
|
private float fireBuffTimer;
|
|
|
- //public int fireDamage = 1;
|
|
|
|
|
private GameObject fireEffect;
|
|
private GameObject fireEffect;
|
|
|
|
|
|
|
|
public virtual void Awake()
|
|
public virtual void Awake()
|
|
@@ -131,10 +125,6 @@ public class MoveCharacter : Character
|
|
|
mecanim.transform.localPosition = Vector3.zero;
|
|
mecanim.transform.localPosition = Vector3.zero;
|
|
|
mecanim.transform.localRotation = Quaternion.Euler(Vector3.zero);
|
|
mecanim.transform.localRotation = Quaternion.Euler(Vector3.zero);
|
|
|
platformRotZ = 0;
|
|
platformRotZ = 0;
|
|
|
- isFrozen = false;
|
|
|
|
|
- ani.speed = 1;
|
|
|
|
|
- if (fireEffect != null) fireEffect.SetActive(false);
|
|
|
|
|
- if (electrifyEffect != null) electrifyEffect.SetActive(false);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//0:漂浮 1:正常 2:无敌
|
|
//0:漂浮 1:正常 2:无敌
|
|
@@ -576,17 +566,15 @@ public class MoveCharacter : Character
|
|
|
{
|
|
{
|
|
|
if (!isElectrify)
|
|
if (!isElectrify)
|
|
|
{
|
|
{
|
|
|
|
|
+ Debug.Log("挂上感电");
|
|
|
isElectrify = true;
|
|
isElectrify = true;
|
|
|
ani.speed = GameManager.instance.attackSpeedScale;
|
|
ani.speed = GameManager.instance.attackSpeedScale;
|
|
|
moveSpeedScale = GameManager.instance.moveSpeedScale;
|
|
moveSpeedScale = GameManager.instance.moveSpeedScale;
|
|
|
attributeStatus.AddVulnerable(GameManager.instance.vulnerableRate, GameManager.instance.electrifyTime);
|
|
attributeStatus.AddVulnerable(GameManager.instance.vulnerableRate, GameManager.instance.electrifyTime);
|
|
|
if (electrifyEffect == null)
|
|
if (electrifyEffect == null)
|
|
|
{
|
|
{
|
|
|
- PoolManager.InstantiateAsync("Prefab/FX/ElectrifyEffect", transform.position + Vector3.up, Quaternion.identity, transform, obj =>
|
|
|
|
|
- {
|
|
|
|
|
- electrifyEffect = obj;
|
|
|
|
|
- electrifyEffect.transform.localPosition = new Vector3(0, 0.8f, 0);
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ electrifyEffect = Instantiate(Resources.Load<GameObject>("Prefab/FX/ElectrifyEffect"), transform.position + Vector3.up, Quaternion.identity, transform);
|
|
|
|
|
+ electrifyEffect.transform.localPosition = new Vector3(0, 0.8f, 0);
|
|
|
}
|
|
}
|
|
|
else electrifyEffect.SetActive(true);
|
|
else electrifyEffect.SetActive(true);
|
|
|
}
|
|
}
|
|
@@ -596,7 +584,8 @@ public class MoveCharacter : Character
|
|
|
|
|
|
|
|
private void LightningStrike()
|
|
private void LightningStrike()
|
|
|
{
|
|
{
|
|
|
- PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/FX/Effc_Fall_thunder"), transform.position, Quaternion.identity, transform);
|
|
|
|
|
|
|
+ CountDownDestory countDownDestory = PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/FX/Effc_Fall_thunder"), transform.position, Quaternion.identity, transform).AddComponent<CountDownDestory>();
|
|
|
|
|
+ countDownDestory.StartCountDown(1f);
|
|
|
BeHit(GameManager.instance.thunderboltDamage);
|
|
BeHit(GameManager.instance.thunderboltDamage);
|
|
|
attributeStatus.AddWeak(1f);
|
|
attributeStatus.AddWeak(1f);
|
|
|
}
|
|
}
|
|
@@ -627,7 +616,7 @@ public class MoveCharacter : Character
|
|
|
isOnFire = true;
|
|
isOnFire = true;
|
|
|
if (fireEffect == null)
|
|
if (fireEffect == null)
|
|
|
{
|
|
{
|
|
|
- fireEffect = PoolManager.Instantiate(Resources.Load<GameObject>("Prefab/FX/FireEffect"), transform.position, Quaternion.identity, transform);
|
|
|
|
|
|
|
+ fireEffect = Instantiate(Resources.Load<GameObject>("Prefab/FX/FireEffect"), transform.position, Quaternion.identity, transform);
|
|
|
fireEffect.transform.localPosition = new Vector3(0, 0.8f, 0);
|
|
fireEffect.transform.localPosition = new Vector3(0, 0.8f, 0);
|
|
|
}
|
|
}
|
|
|
else fireEffect.SetActive(true);
|
|
else fireEffect.SetActive(true);
|
|
@@ -664,4 +653,17 @@ public class MoveCharacter : Character
|
|
|
Debug.Log("爆炸");
|
|
Debug.Log("爆炸");
|
|
|
}
|
|
}
|
|
|
#endregion
|
|
#endregion
|
|
|
|
|
+
|
|
|
|
|
+ protected virtual void OnDisable()
|
|
|
|
|
+ {
|
|
|
|
|
+ isOnFire = false;
|
|
|
|
|
+ fireStacks = 0;
|
|
|
|
|
+ if (fireEffect != null) fireEffect.SetActive(false);
|
|
|
|
|
+ isFrozen = false;
|
|
|
|
|
+ isElectrify = false;
|
|
|
|
|
+ if (electrifyEffect != null) electrifyEffect.SetActive(false);
|
|
|
|
|
+ ani.speed = 1;
|
|
|
|
|
+ moveSpeedScale = 1f;
|
|
|
|
|
+ Debug.Log("失活");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|