if anyone is familiar with this section i dont know what i am doing wrong. I have followed as instructed any ideas or have i just looked at my screen too long?
Enemy script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField] int goldReward = 25;
[SerializeField] int goldPenalty = 25;
Bank bank;
void Start()
{
bank = GetComponent<Bank>();
}
public void RewardGold()
{
if (bank == null) { return; }
bank.Deposit(goldReward);
}
public void StealGold()
{
if (bank == null) { return; }
bank.Withdraw(goldPenalty);
}
}
EnemyHealth Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Enemy : MonoBehaviour
{
[SerializeField] int goldReward = 25;
[SerializeField] int goldPenalty = 25;
Bank bank;
void Start()
{
bank = GetComponent<Bank>();
}
public void RewardGold()
{
if (bank == null) { return; }
bank.Deposit(goldReward);
}
public void StealGold()
{
if (bank == null) { return; }
bank.Withdraw(goldPenalty);
}
}