diff options
Diffstat (limited to 'GameCode/GunLevel.cs')
-rw-r--r-- | GameCode/GunLevel.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/GameCode/GunLevel.cs b/GameCode/GunLevel.cs new file mode 100644 index 0000000..427e442 --- /dev/null +++ b/GameCode/GunLevel.cs @@ -0,0 +1,21 @@ +using System; +using UnityEngine; + +public class GunLevel : MonoBehaviour +{ + public Gun copyTo; + + private Gun copyFrom; + + private void Start() + { + copyFrom = GetComponent<Gun>(); + AttackLevel componentInParent = GetComponentInParent<AttackLevel>(); + componentInParent.LevelUpAction = (Action<int>)Delegate.Combine(componentInParent.LevelUpAction, new Action<int>(BuffGun)); + } + + public void BuffGun(int level) + { + ApplyCardStats.CopyGunStats(copyFrom, copyTo); + } +} |