30 lines
989 B
C#
30 lines
989 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class RepairHudController : MonoBehaviour
|
|
{
|
|
[SerializeField] private TextMeshProUGUI _currentItemText;
|
|
[SerializeField] private TextMeshProUGUI _timeToFixText;
|
|
[SerializeField] private TextMeshProUGUI _costToFixText;
|
|
|
|
private Object _currentObject;
|
|
|
|
RepairStationBehaviour _repairStationBehaviour;
|
|
|
|
public void SetObject(RepairStationBehaviour repairStationBehaviour, Object obj, float timeToFix, float costToFix) {
|
|
_currentObject = obj;
|
|
_repairStationBehaviour = repairStationBehaviour;
|
|
_currentItemText.text = obj.ObjectSo.objectName;
|
|
_timeToFixText.text = timeToFix.ToString();
|
|
_costToFixText.text = costToFix.ToString();
|
|
}
|
|
|
|
//Callback for if the player quits the UI without clicking the repair button
|
|
public void ConfirmRepair() {
|
|
_repairStationBehaviour.ConfirmRepair();
|
|
}
|
|
|
|
}
|