/*This is an example of "can I use a Delegate this way as well"*/
private int Health, MagicPoints, ExperiencePoints;
private delegate int StatBars(int Hp, int Mp, int Xp);
private void Start()
{
PassExample(Health);
}
private void PassExample(StatBars myStats)
{
myStats(Health, MagicPoints, ExperiencePoints);
}
private void Health(int hp, int mp, int xp)
{
hp = Health = 25;
mp = MagicPoints = 50;
xp = ExperiencePoints = 0;
}
/*This is an example of "can I use a Delegate this way as well"*/
private int Health, MagicPoints, ExperiencePoints;
private delegate int StatBars(int Hp, int Mp, int Xp);
private void Start()
{
PassExample(Health);
}
private void PassExample(StatBars myStats)
{
myStats(Health, MagicPoints, ExperiencePoints);
}
private void Health(int hp, int mp, int xp)
{
hp = Health = 25;
mp = MagicPoints = 50;
xp = ExperiencePoints = 0;
}