Hey guys I’m new to c# and am having trouble getting my player health returned. Any ideas
using UnityEngine;
using System.Collections;
public class PlayerHealth : MonoBehaviour {
// players health based on class
// temp value 100 inplace
public int maxHealth = 100;
public int currentHealth = maxHealth;
// increase health based on additional attributes
public float healthBuffer = 1.1f;
public void AdjustCurrentHealth(int adjustment) {
currentHealth += adjustment;
if(currentHealth < 0) {
currentHealth = 0;
Die();
}
}
}[code]
[code]
using UnityEngine;
using System.Collections;
public class BaseStats {
// attributes
public int strength;
public int stamina;
public int intelligence;
public int agility;
public int willpower;
public float GetPlayerHealth() {
// return health with buff
}
public void SetPlayerHealth() {
// set players health to 'playerhealth' * 'healthBuffer'
}
}[code]