|
@@ -33,6 +33,7 @@ public class AttackInfo
|
|
|
public Vector3 attackDir;
|
|
public Vector3 attackDir;
|
|
|
[LabelText("击中特效")] public GameObject effect;
|
|
[LabelText("击中特效")] public GameObject effect;
|
|
|
public AttackEffect[] attackEffect;
|
|
public AttackEffect[] attackEffect;
|
|
|
|
|
+ [HideInInspector] public AttackMethod_Type attackMethod_Type;
|
|
|
|
|
|
|
|
//漂浮
|
|
//漂浮
|
|
|
[Serializable]public struct FloatState
|
|
[Serializable]public struct FloatState
|
|
@@ -153,23 +154,31 @@ public class AttackInfo
|
|
|
[ShowIf("ShowSustainedInjuryValue")][LabelText("持续伤害参数")]
|
|
[ShowIf("ShowSustainedInjuryValue")][LabelText("持续伤害参数")]
|
|
|
public SustainedInjury sustainedInjury;
|
|
public SustainedInjury sustainedInjury;
|
|
|
|
|
|
|
|
- [DisplayOnly]
|
|
|
|
|
- public bool isDemSummon;
|
|
|
|
|
-
|
|
|
|
|
public void CopyTo(AttackInfo ai)
|
|
public void CopyTo(AttackInfo ai)
|
|
|
{
|
|
{
|
|
|
|
|
+ ai.attackValue = attackValue;
|
|
|
ai.damage = damage;
|
|
ai.damage = damage;
|
|
|
ai.attackDir = attackDir;
|
|
ai.attackDir = attackDir;
|
|
|
|
|
+ ai.effect = effect;
|
|
|
|
|
+ ai.attackEffect = attackEffect;
|
|
|
|
|
+ ai.attackMethod_Type = attackMethod_Type;
|
|
|
|
|
+ ai.floatState = floatState;
|
|
|
ai.blowUp = blowUp;
|
|
ai.blowUp = blowUp;
|
|
|
ai.shotDown = shotDown;
|
|
ai.shotDown = shotDown;
|
|
|
ai.weak = weak;
|
|
ai.weak = weak;
|
|
|
ai.armorPiercing = armorPiercing;
|
|
ai.armorPiercing = armorPiercing;
|
|
|
|
|
+ ai.vulnerable = vulnerable;
|
|
|
|
|
+ ai.stackingWounds = stackingWounds;
|
|
|
ai.changeDamage = changeDamage;
|
|
ai.changeDamage = changeDamage;
|
|
|
ai.sustainedInjury = sustainedInjury;
|
|
ai.sustainedInjury = sustainedInjury;
|
|
|
- ai.stackingWounds = stackingWounds;
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+public enum AttackMethod_Type
|
|
|
|
|
+{
|
|
|
|
|
+ Attack_Summon,
|
|
|
|
|
+ Attack_March,
|
|
|
|
|
+}
|
|
|
public class AttackController : MonoBehaviour
|
|
public class AttackController : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
//攻击类型
|
|
//攻击类型
|
|
@@ -182,11 +191,13 @@ public class AttackController : MonoBehaviour
|
|
|
Dash = 3, //英灵刺客,后面请删掉
|
|
Dash = 3, //英灵刺客,后面请删掉
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
[System.Serializable]
|
|
[System.Serializable]
|
|
|
public struct SpineAniKey
|
|
public struct SpineAniKey
|
|
|
{
|
|
{
|
|
|
public string aniName;
|
|
public string aniName;
|
|
|
public List<AttackKeyType> keys;
|
|
public List<AttackKeyType> keys;
|
|
|
|
|
+ [LabelText("动画时长")] public float totalTime;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public enum KeyType
|
|
public enum KeyType
|
|
@@ -198,7 +209,6 @@ public class AttackController : MonoBehaviour
|
|
|
[System.Serializable]
|
|
[System.Serializable]
|
|
|
public struct AttackKeyType
|
|
public struct AttackKeyType
|
|
|
{
|
|
{
|
|
|
- public int attackMethod;
|
|
|
|
|
public KeyType attackType;
|
|
public KeyType attackType;
|
|
|
public string startKeyName;
|
|
public string startKeyName;
|
|
|
public float startKeyTime;
|
|
public float startKeyTime;
|
|
@@ -210,10 +220,7 @@ public class AttackController : MonoBehaviour
|
|
|
[System.Serializable]
|
|
[System.Serializable]
|
|
|
public struct AttackMethod
|
|
public struct AttackMethod
|
|
|
{
|
|
{
|
|
|
- [Header("起手式id=0,行军式id>=1")]
|
|
|
|
|
- public int id;
|
|
|
|
|
-
|
|
|
|
|
- [LabelText("攻击名称")]
|
|
|
|
|
|
|
+ [LabelText("攻击动画名称")]
|
|
|
public string attackName;
|
|
public string attackName;
|
|
|
|
|
|
|
|
[LabelText("攻击类型")]
|
|
[LabelText("攻击类型")]
|
|
@@ -224,14 +231,15 @@ public class AttackController : MonoBehaviour
|
|
|
public AttackTrigger attackTrigger;
|
|
public AttackTrigger attackTrigger;
|
|
|
|
|
|
|
|
[Header("攻击距离")]
|
|
[Header("攻击距离")]
|
|
|
|
|
+ public bool needToChange;
|
|
|
|
|
+ [ShowIf("@!needToChange")]
|
|
|
public float attackDistance;
|
|
public float attackDistance;
|
|
|
[ShowIf("needToChange")]
|
|
[ShowIf("needToChange")]
|
|
|
public float maxAttackDis, minAttackDis;
|
|
public float maxAttackDis, minAttackDis;
|
|
|
- public bool needToChange;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[Header("目标")]
|
|
[Header("目标")]
|
|
|
public SearchMode searchMode;
|
|
public SearchMode searchMode;
|
|
|
- public List<TargetType> targetTypes;
|
|
|
|
|
public bool canHitFly;
|
|
public bool canHitFly;
|
|
|
public int armorPiercing; //穿甲率
|
|
public int armorPiercing; //穿甲率
|
|
|
|
|
|
|
@@ -256,134 +264,112 @@ public class AttackController : MonoBehaviour
|
|
|
|
|
|
|
|
private Character owner;
|
|
private Character owner;
|
|
|
|
|
|
|
|
- [Header("所有攻击帧事件及时间")]
|
|
|
|
|
- public List<SpineAniKey> attackKeys;
|
|
|
|
|
- public List<float> keyTimes; //所有的帧事件时间
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public float attackTime; //攻击剩余时间
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public float attackKeyCount; //攻击进行时间
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public float nextStartKeyTime, nextEndKeyTime;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public int curKeyNum; //当前锁定到第几个帧事件
|
|
|
|
|
-
|
|
|
|
|
- [Header("攻击类型")]
|
|
|
|
|
- public AttackType attackType;
|
|
|
|
|
-
|
|
|
|
|
- [Header("攻击参数")]
|
|
|
|
|
[LabelText("攻击间隔")]
|
|
[LabelText("攻击间隔")]
|
|
|
public float attackInterval;
|
|
public float attackInterval;
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public int curDamage;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public bool canHitFly;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public AttackInfo attackInfo;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
public GameObject addAttackEffect;
|
|
public GameObject addAttackEffect;
|
|
|
- [HideInInspector]
|
|
|
|
|
- public SpecialSkills skill;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public float attackDistance;
|
|
|
|
|
|
|
|
|
|
[Header("攻击范围")]
|
|
[Header("攻击范围")]
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public AttackTrigger attackTrigger;
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
public bool isAttackTriggerOn = false; //当前Attack Trigger是否开启
|
|
public bool isAttackTriggerOn = false; //当前Attack Trigger是否开启
|
|
|
|
|
|
|
|
- [Header("远程单位")]
|
|
|
|
|
- [HideInInspector]
|
|
|
|
|
- public GameObject bulletPrefab; //子弹
|
|
|
|
|
|
|
+ public List<TargetType> targetTypes;
|
|
|
|
|
+ [DisplayOnly] public int attackSummonId;
|
|
|
|
|
+ [DisplayOnly] public int attackMarchId;
|
|
|
|
|
+ [LabelText("攻击模式:起手式")] public AttackMethod[] attackMethod_summon;
|
|
|
|
|
+ [LabelText("攻击模式:行军式")] public AttackMethod[] attackMethod_march;
|
|
|
|
|
+ [DisplayOnly] public AttackMethod curAttackMethod;
|
|
|
|
|
+
|
|
|
|
|
+ [Header("所有攻击帧事件及时间")]
|
|
|
|
|
+ public List<SpineAniKey> attackKeys;
|
|
|
|
|
+ public List<float> keyTimes; //所有的帧事件时间
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public List<Transform> shootPos; //子弹发射位置
|
|
|
|
|
|
|
+ public float attackTime; //攻击剩余时间
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public bool shootTrack = false; //是否初始时瞄准目标
|
|
|
|
|
|
|
+ public float attackKeyCount; //攻击进行时间
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public bool shootAlwaysTrack = false; //是否始终追踪
|
|
|
|
|
-
|
|
|
|
|
- [Header("目标")]
|
|
|
|
|
- public List<TargetType> targetTypes;
|
|
|
|
|
- [DisplayOnly]
|
|
|
|
|
- public List<Character> beTargetCharacter = new List<Character>(); //被哪些锁定
|
|
|
|
|
- //public float getDistanceOffset = 0f;
|
|
|
|
|
-
|
|
|
|
|
- [Header("攻击模式")]
|
|
|
|
|
- public AttackMethod[] attackMethod;
|
|
|
|
|
|
|
+ public float nextStartKeyTime, nextEndKeyTime;
|
|
|
[HideInInspector]
|
|
[HideInInspector]
|
|
|
- public AttackMethod curAttackMethod;
|
|
|
|
|
|
|
+ public int curKeyNum; //当前锁定到第几个帧事件
|
|
|
|
|
|
|
|
private SoldierLevelRecord slr;
|
|
private SoldierLevelRecord slr;
|
|
|
-
|
|
|
|
|
|
|
+ [DisplayOnly] public List<Character> beTargetCharacter = new List<Character>(); //被哪些锁定
|
|
|
public void Init()
|
|
public void Init()
|
|
|
{
|
|
{
|
|
|
owner = GetComponent<Character>();
|
|
owner = GetComponent<Character>();
|
|
|
- if (attackMethod.Length > 0)
|
|
|
|
|
|
|
+ for (int i = 0; i < attackMethod_summon.Length; i++)
|
|
|
{
|
|
{
|
|
|
- attackInfo = attackMethod[0].attackInfo;
|
|
|
|
|
- curDamage = attackInfo.damage;
|
|
|
|
|
|
|
+ if (attackMethod_summon[i].needToChange)
|
|
|
|
|
+ {
|
|
|
|
|
+ attackMethod_summon[i].attackDistance = UnityEngine.Random.Range(attackMethod_summon[i].minAttackDis,
|
|
|
|
|
+ attackMethod_summon[i].maxAttackDis);
|
|
|
|
|
+ }
|
|
|
|
|
+ attackMethod_summon[i].attackInfo.attackMethod_Type = AttackMethod_Type.Attack_Summon;
|
|
|
}
|
|
}
|
|
|
- for (int i = 0; i < attackMethod.Length; i++)
|
|
|
|
|
|
|
+ for (int i = 0; i < attackMethod_march.Length; i++)
|
|
|
{
|
|
{
|
|
|
- if (attackMethod[i].needToChange)
|
|
|
|
|
|
|
+ if (attackMethod_march[i].needToChange)
|
|
|
{
|
|
{
|
|
|
- attackMethod[i].attackDistance = UnityEngine.Random.Range(attackMethod[i].minAttackDis,
|
|
|
|
|
- attackMethod[i].maxAttackDis);
|
|
|
|
|
|
|
+ attackMethod_march[i].attackDistance = UnityEngine.Random.Range(attackMethod_march[i].minAttackDis,
|
|
|
|
|
+ attackMethod_march[i].maxAttackDis);
|
|
|
}
|
|
}
|
|
|
|
|
+ attackMethod_march[i].attackInfo.attackMethod_Type = AttackMethod_Type.Attack_March;
|
|
|
}
|
|
}
|
|
|
- attackDistance = attackMethod[0].attackDistance;
|
|
|
|
|
slr = GameManager.instance.GetComponent<SoldierLevelRecord>();
|
|
slr = GameManager.instance.GetComponent<SoldierLevelRecord>();
|
|
|
|
|
+ attackMarchId = 0;
|
|
|
|
|
+ attackSummonId = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void OnEnable()
|
|
private void OnEnable()
|
|
|
{
|
|
{
|
|
|
- if (attackTrigger != null)
|
|
|
|
|
- {
|
|
|
|
|
- attackTrigger.gameObject.SetActive(false);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void ChooseAttack(int id)
|
|
|
|
|
|
|
+ public void ChooseAttack(int id, AttackMethod_Type attackMethod_Type)
|
|
|
{
|
|
{
|
|
|
- //默认起手式只使用一次,id=0为起手式
|
|
|
|
|
- curAttackMethod = attackMethod[id];
|
|
|
|
|
- attackType = curAttackMethod.attackType;
|
|
|
|
|
- canHitFly = curAttackMethod.canHitFly;
|
|
|
|
|
- attackInfo = curAttackMethod.attackInfo;
|
|
|
|
|
- curDamage = attackInfo.damage;
|
|
|
|
|
- attackTrigger = curAttackMethod.attackTrigger;
|
|
|
|
|
- Demonic dem = owner.GetComponent<Demonic>();
|
|
|
|
|
- if (dem)
|
|
|
|
|
- {
|
|
|
|
|
- for (int i = 0; i < 3; i++)
|
|
|
|
|
- {
|
|
|
|
|
- if (GameManager.curSoldiers[i] == dem.soldierType)
|
|
|
|
|
- {
|
|
|
|
|
- attackTrigger.attackInfo.armorPiercing.rate += slr.seb[i].armorPiercing;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- bulletPrefab = curAttackMethod.bulletPrefab;
|
|
|
|
|
- shootPos = curAttackMethod.shootPos;
|
|
|
|
|
- shootTrack = curAttackMethod.shootTrack;
|
|
|
|
|
- shootAlwaysTrack = curAttackMethod.shootAlwaysTrack;
|
|
|
|
|
- targetTypes = curAttackMethod.targetTypes;
|
|
|
|
|
- if (attackType == AttackType.Special && skill == null)
|
|
|
|
|
|
|
+ switch (attackMethod_Type)
|
|
|
{
|
|
{
|
|
|
- skill = curAttackMethod.skill;
|
|
|
|
|
- skill.owner = owner;
|
|
|
|
|
|
|
+ case AttackMethod_Type.Attack_Summon:
|
|
|
|
|
+ curAttackMethod = attackMethod_summon[id];
|
|
|
|
|
+ break;
|
|
|
|
|
+ case AttackMethod_Type.Attack_March:
|
|
|
|
|
+ curAttackMethod = attackMethod_march[id];
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
- attackDistance = curAttackMethod.attackDistance;
|
|
|
|
|
-
|
|
|
|
|
- if (id == 0 && GetComponent<Demonic>())
|
|
|
|
|
|
|
+ if (curAttackMethod.attackType == AttackType.Shoot)
|
|
|
{
|
|
{
|
|
|
- attackInfo.isDemSummon = true;
|
|
|
|
|
|
|
+ curAttackMethod.attackTrigger.isShoot = true;
|
|
|
}
|
|
}
|
|
|
- else
|
|
|
|
|
|
|
+
|
|
|
|
|
+ AttackTrigger attackTrigger = curAttackMethod.attackTrigger;
|
|
|
|
|
+ attackTrigger.attackInfo = curAttackMethod.attackInfo;
|
|
|
|
|
+ switch (curAttackMethod.attackType)
|
|
|
{
|
|
{
|
|
|
- attackInfo.isDemSummon = false;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ case AttackType.Melee:
|
|
|
|
|
+ break;
|
|
|
|
|
+ case AttackType.Shoot:
|
|
|
|
|
+ attackTrigger.isShoot = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case AttackType.Special:
|
|
|
|
|
+ curAttackMethod.skill.Attack();
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
|
|
+ //升级时加穿甲值,需要移动到升级的地方去
|
|
|
|
|
+ //目前没有用到穿甲值故暂时注释掉
|
|
|
|
|
+ //Demonic dem = owner as Demonic;
|
|
|
|
|
+ //if (dem)
|
|
|
|
|
+ //{
|
|
|
|
|
+ // for (int i = 0; i < 3; i++)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // if (GameManager.curSoldiers[i] == dem.soldierType)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // curAttackMethod.attackTrigger.attackInfo.armorPiercing.rate += slr.seb[i].armorPiercing;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ //}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void SetNextKeyTimes()
|
|
public void SetNextKeyTimes()
|
|
@@ -398,19 +384,15 @@ public class AttackController : MonoBehaviour
|
|
|
|
|
|
|
|
public virtual void Attack_summon()
|
|
public virtual void Attack_summon()
|
|
|
{
|
|
{
|
|
|
- owner.ani.Play("attack_summon", 0, 0);
|
|
|
|
|
- if (attackType == AttackType.Shoot)
|
|
|
|
|
- {
|
|
|
|
|
- attackTrigger.isShoot = true;
|
|
|
|
|
- attackTrigger.type = AttackTrigger.attackType.summon;
|
|
|
|
|
- }
|
|
|
|
|
- attackTime = owner.totalAttack_summonTime;
|
|
|
|
|
|
|
+ ChooseAttack(attackSummonId, AttackMethod_Type.Attack_Summon);
|
|
|
|
|
+ owner.ani.Play(curAttackMethod.attackName, 0, 0);
|
|
|
attackKeyCount = 0;
|
|
attackKeyCount = 0;
|
|
|
keyTimes = new List<float>();
|
|
keyTimes = new List<float>();
|
|
|
foreach (SpineAniKey sak in attackKeys)
|
|
foreach (SpineAniKey sak in attackKeys)
|
|
|
{
|
|
{
|
|
|
- if (sak.aniName == "attack_summon")
|
|
|
|
|
|
|
+ if (sak.aniName == curAttackMethod.attackName)
|
|
|
{
|
|
{
|
|
|
|
|
+ attackTime = sak.totalTime;
|
|
|
foreach (AttackKeyType akt in sak.keys)
|
|
foreach (AttackKeyType akt in sak.keys)
|
|
|
{
|
|
{
|
|
|
keyTimes.Add(akt.startKeyTime);
|
|
keyTimes.Add(akt.startKeyTime);
|
|
@@ -421,57 +403,20 @@ public class AttackController : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
curKeyNum = 0;
|
|
curKeyNum = 0;
|
|
|
SetNextKeyTimes();
|
|
SetNextKeyTimes();
|
|
|
-
|
|
|
|
|
- switch (attackType)
|
|
|
|
|
- {
|
|
|
|
|
- case AttackType.Melee:
|
|
|
|
|
- attackTrigger.attackInfo = attackInfo;
|
|
|
|
|
- break;
|
|
|
|
|
- case AttackType.Special:
|
|
|
|
|
- skill.Attack();
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- ChooseAttack(attackMethod[0].id);
|
|
|
|
|
owner.ChangeState(CharacterState.Attack);
|
|
owner.ChangeState(CharacterState.Attack);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public virtual void Attack_march(int id)
|
|
|
|
|
|
|
+ public virtual void Attack_march()
|
|
|
{
|
|
{
|
|
|
- Vector3 leftDir = owner.GetMoveDir();
|
|
|
|
|
- if (leftDir.x > 0.3f)
|
|
|
|
|
- {
|
|
|
|
|
- if (owner.bodyTrans.localScale.x > 0)
|
|
|
|
|
- {
|
|
|
|
|
- owner.Turn();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- else if (leftDir.x < -0.3f)
|
|
|
|
|
- {
|
|
|
|
|
- if (owner.bodyTrans.localScale.x < 0)
|
|
|
|
|
- {
|
|
|
|
|
- owner.Turn();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- owner.ani.Play("attack_march", 0, 0);
|
|
|
|
|
- if (attackType == AttackType.Shoot)
|
|
|
|
|
- {
|
|
|
|
|
- attackTrigger.isShoot = true;
|
|
|
|
|
- attackTrigger.type = AttackTrigger.attackType.march;
|
|
|
|
|
- }
|
|
|
|
|
- if (attackType == AttackType.Special)
|
|
|
|
|
- {
|
|
|
|
|
- skill.Attack();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- attackTime = owner.totalAttack_marchTime;
|
|
|
|
|
|
|
+ ChooseAttack(attackMarchId, AttackMethod_Type.Attack_March);
|
|
|
|
|
+ owner.ani.Play(curAttackMethod.attackName, 0, 0);
|
|
|
attackKeyCount = 0;
|
|
attackKeyCount = 0;
|
|
|
keyTimes = new List<float>();
|
|
keyTimes = new List<float>();
|
|
|
foreach (SpineAniKey sak in attackKeys)
|
|
foreach (SpineAniKey sak in attackKeys)
|
|
|
{
|
|
{
|
|
|
- if (sak.aniName == "attack_march")
|
|
|
|
|
|
|
+ if (sak.aniName == curAttackMethod.attackName)
|
|
|
{
|
|
{
|
|
|
|
|
+ attackTime = sak.totalTime;
|
|
|
foreach (AttackKeyType akt in sak.keys)
|
|
foreach (AttackKeyType akt in sak.keys)
|
|
|
{
|
|
{
|
|
|
keyTimes.Add(akt.startKeyTime);
|
|
keyTimes.Add(akt.startKeyTime);
|
|
@@ -482,15 +427,14 @@ public class AttackController : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
curKeyNum = 0;
|
|
curKeyNum = 0;
|
|
|
SetNextKeyTimes();
|
|
SetNextKeyTimes();
|
|
|
- attackTrigger.attackInfo = attackInfo;
|
|
|
|
|
owner.ChangeState(CharacterState.Attack);
|
|
owner.ChangeState(CharacterState.Attack);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public virtual void AttackShootEvent(int attackId, int shootId)
|
|
public virtual void AttackShootEvent(int attackId, int shootId)
|
|
|
{
|
|
{
|
|
|
- GameObject bulletObj = PoolManager.Instantiate(bulletPrefab);
|
|
|
|
|
|
|
+ GameObject bulletObj = PoolManager.Instantiate(curAttackMethod.bulletPrefab);
|
|
|
Bullet bullet = bulletObj.GetComponent<Bullet>();
|
|
Bullet bullet = bulletObj.GetComponent<Bullet>();
|
|
|
- Vector3 attackDir = attackInfo.attackDir.normalized;
|
|
|
|
|
|
|
+ Vector3 attackDir = curAttackMethod.attackInfo.attackDir.normalized;
|
|
|
if (owner.bodyTrans.localScale.x < 0)
|
|
if (owner.bodyTrans.localScale.x < 0)
|
|
|
{
|
|
{
|
|
|
attackDir.x = -attackDir.x;
|
|
attackDir.x = -attackDir.x;
|
|
@@ -499,8 +443,8 @@ public class AttackController : MonoBehaviour
|
|
|
{
|
|
{
|
|
|
bullet.canTransmit = true;
|
|
bullet.canTransmit = true;
|
|
|
}
|
|
}
|
|
|
- bullet.BeShoot(owner, shootPos[shootId].position, attackDir, shootTrack,
|
|
|
|
|
- shootAlwaysTrack, owner.attackTarget ? owner.attackTarget : null);
|
|
|
|
|
|
|
+ bullet.BeShoot(owner, curAttackMethod.shootPos[shootId].position, attackDir, curAttackMethod.shootTrack,
|
|
|
|
|
+ curAttackMethod.shootAlwaysTrack, owner.attackTarget ? owner.attackTarget : null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void JudgeTriggerOnOff()
|
|
public void JudgeTriggerOnOff()
|
|
@@ -509,17 +453,17 @@ public class AttackController : MonoBehaviour
|
|
|
attackKeyCount += Time.deltaTime;
|
|
attackKeyCount += Time.deltaTime;
|
|
|
if (!isAttackTriggerOn && attackKeyCount >= nextStartKeyTime && attackKeyCount <= nextEndKeyTime)
|
|
if (!isAttackTriggerOn && attackKeyCount >= nextStartKeyTime && attackKeyCount <= nextEndKeyTime)
|
|
|
{
|
|
{
|
|
|
- if (attackType == AttackType.Special)
|
|
|
|
|
|
|
+ if (curAttackMethod.attackType == AttackType.Special)
|
|
|
{
|
|
{
|
|
|
- skill.Attack();
|
|
|
|
|
|
|
+ curAttackMethod.skill.Attack();
|
|
|
}
|
|
}
|
|
|
isAttackTriggerOn = true;
|
|
isAttackTriggerOn = true;
|
|
|
- attackTrigger.gameObject.SetActive(true);
|
|
|
|
|
|
|
+ curAttackMethod.attackTrigger.gameObject.SetActive(true);
|
|
|
}
|
|
}
|
|
|
else if (isAttackTriggerOn && attackKeyCount >= nextEndKeyTime)
|
|
else if (isAttackTriggerOn && attackKeyCount >= nextEndKeyTime)
|
|
|
{
|
|
{
|
|
|
isAttackTriggerOn = false;
|
|
isAttackTriggerOn = false;
|
|
|
- attackTrigger.gameObject.SetActive(false);
|
|
|
|
|
|
|
+ curAttackMethod.attackTrigger.gameObject.SetActive(false);
|
|
|
SetNextKeyTimes();
|
|
SetNextKeyTimes();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|