diff options
| author | chai <215380520@qq.com> | 2023-11-02 11:51:31 +0800 |
|---|---|---|
| committer | chai <215380520@qq.com> | 2023-11-02 11:51:31 +0800 |
| commit | 7f493f682503f5186308de7b8f74b5b49233cfe4 (patch) | |
| tree | 8a91e2056bc79788ee4735dce88b8d516ba12beb /GameCode/PerkDamageModifyerPlayerunitAuto.cs | |
+init
Diffstat (limited to 'GameCode/PerkDamageModifyerPlayerunitAuto.cs')
| -rw-r--r-- | GameCode/PerkDamageModifyerPlayerunitAuto.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/GameCode/PerkDamageModifyerPlayerunitAuto.cs b/GameCode/PerkDamageModifyerPlayerunitAuto.cs new file mode 100644 index 0000000..fe8a9de --- /dev/null +++ b/GameCode/PerkDamageModifyerPlayerunitAuto.cs @@ -0,0 +1,26 @@ +using UnityEngine; + +public class PerkDamageModifyerPlayerunitAuto : MonoBehaviour +{ + private void Start() + { + PerkManager instance = PerkManager.instance; + if (instance.WarriorModeActive) + { + AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true); + for (int i = 0; i < componentsInChildren.Length; i++) + { + componentsInChildren[i].DamageMultiplyer *= instance.warriorModeAllyDmgMulti; + } + } + if (instance.CommanderModeActive) + { + AutoAttack[] componentsInChildren = GetComponentsInChildren<AutoAttack>(includeInactive: true); + for (int i = 0; i < componentsInChildren.Length; i++) + { + componentsInChildren[i].DamageMultiplyer *= instance.commanderModeAllyDmgMulti; + } + } + Object.Destroy(this); + } +} |
