using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; public class Camp : MonoBehaviour { public int currentDefense = 100; public int maxDefense = 100; public int fireRange = 3; public int fireAttackDamage = 0; public Side side; public Transform defenseText; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { defenseText.GetComponent().text = currentDefense.ToString(); } public void TakeDamage(int damage) { currentDefense -= damage; if (currentDefense < 0) { currentDefense = 0; } } }