Complete basic frying logic

This commit is contained in:
BuyMyMojo 2023-03-02 04:34:08 +11:00
parent ef0155632a
commit 9da447f835
19 changed files with 902 additions and 346 deletions

View file

@ -6,19 +6,26 @@ using UnityEngine.UI;
public class ProgressBarUI : MonoBehaviour
{
[SerializeField] private CuttingCounter cuttingCounter;
[SerializeField] private GameObject hasProgressGameObject;
[SerializeField] private Image barImage;
private IHasProgress hasProgress;
private void Start()
{
cuttingCounter.OnProgressChange += CuttingCounter_OnProgressChange;
hasProgress = hasProgressGameObject.GetComponent<IHasProgress>();
if (hasProgress == null) {
Debug.LogError("Game Object " + hasProgressGameObject + " does not have a componenet that implements IHasProgress!");
}
hasProgress.OnProgressChange += HasProgress_OnProgressChange;
barImage.fillAmount = 0f;
Hide();
}
private void CuttingCounter_OnProgressChange(object sender, CuttingCounter.OnProgressChangeEventsArgs e)
private void HasProgress_OnProgressChange(object sender, IHasProgress.OnProgressChangeEventsArgs e)
{
barImage.fillAmount = e.progressNormalized;