using System; using UnityEngine; public class GunLevel : MonoBehaviour { public Gun copyTo; private Gun copyFrom; private void Start() { copyFrom = GetComponent(); AttackLevel componentInParent = GetComponentInParent(); componentInParent.LevelUpAction = (Action)Delegate.Combine(componentInParent.LevelUpAction, new Action(BuffGun)); } public void BuffGun(int level) { ApplyCardStats.CopyGunStats(copyFrom, copyTo); } }