// Start is called before the first frame update void Start() { pb = transform.root.gameObject.GetComponent <PlayerBase>(); soldier = transform.root.gameObject; soldierStat = transform.root.gameObject.GetComponent <SoldierStat>(); soldierNumber = FindObjectOfType <SoldierNumber>(); soldierFactory = FindObjectOfType <SoldierFactory>(); soldierHealth.text = pb.hp + "/" + pb.hp; soldierPower.text = pb.power + "/" + pb.power; }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Start is called before the first frame update void Start() { soldierNumber = FindObjectOfType <SoldierNumber>(); number.text = soldierNumber.curPeopleNum + "/" + soldierNumber.maxPeopleNum; }