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

@ -3,14 +3,10 @@ using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CuttingCounter : BaseCounter
public class CuttingCounter : BaseCounter, IHasProgress
{
public event EventHandler<OnProgressChangeEventsArgs> OnProgressChange;
public class OnProgressChangeEventsArgs : EventArgs
{
public float progressNormalized;
}
public event EventHandler<IHasProgress.OnProgressChangeEventsArgs> OnProgressChange;
public event EventHandler OnCut;
[SerializeField] private CuttingRecipeSO[] cuttingRecipeSOArray;
@ -33,7 +29,7 @@ public class CuttingCounter : BaseCounter
CuttingRecipeSO cuttingRecipeSO = GetCuttingRecipeSOWithInput(GetKitchenObject().GetKitchenObjectSO());
OnProgressChange?.Invoke(this, new OnProgressChangeEventsArgs
OnProgressChange?.Invoke(this, new IHasProgress.OnProgressChangeEventsArgs
{
progressNormalized = (float)cuttingProgress / cuttingRecipeSO.cuttingProgressMax,
});
@ -71,7 +67,7 @@ public class CuttingCounter : BaseCounter
CuttingRecipeSO cuttingRecipeSO = GetCuttingRecipeSOWithInput(GetKitchenObject().GetKitchenObjectSO());
OnProgressChange?.Invoke(this, new OnProgressChangeEventsArgs
OnProgressChange?.Invoke(this, new IHasProgress.OnProgressChangeEventsArgs
{
progressNormalized = (float)cuttingProgress / cuttingRecipeSO.cuttingProgressMax,
});