using UnityEngine; public class PerkDamageModifyerPlayerunitAuto : MonoBehaviour { private void Start() { PerkManager instance = PerkManager.instance; if (instance.WarriorModeActive) { AutoAttack[] componentsInChildren = GetComponentsInChildren(includeInactive: true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].DamageMultiplyer *= instance.warriorModeAllyDmgMulti; } } if (instance.CommanderModeActive) { AutoAttack[] componentsInChildren = GetComponentsInChildren(includeInactive: true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].DamageMultiplyer *= instance.commanderModeAllyDmgMulti; } } Object.Destroy(this); } }