Add Delivery Manager UI and UI logic
This commit is contained in:
parent
8c5f4f2acf
commit
3ec46256e8
89 changed files with 14001 additions and 12 deletions
|
@ -1,3 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
@ -5,6 +6,8 @@ using UnityEngine;
|
|||
public class DeliveryManager : MonoBehaviour
|
||||
{
|
||||
|
||||
public event EventHandler OnRecipeSpawned;
|
||||
public event EventHandler OnRecipeCompleted;
|
||||
public static DeliveryManager Instance { get; private set; }
|
||||
|
||||
[SerializeField] private RecipeListSO recipeListSO;
|
||||
|
@ -30,11 +33,11 @@ public class DeliveryManager : MonoBehaviour
|
|||
|
||||
if (waitingRecipeSOList.Count < waitingRecipesMax)
|
||||
{
|
||||
RecipeSO waitingRecipeSO = recipeListSO.recipeSOList[Random.Range(0, recipeListSO.recipeSOList.Count)];
|
||||
|
||||
Debug.Log(waitingRecipeSO.recipeName);
|
||||
RecipeSO waitingRecipeSO = recipeListSO.recipeSOList[UnityEngine.Random.Range(0, recipeListSO.recipeSOList.Count)];
|
||||
|
||||
waitingRecipeSOList.Add(waitingRecipeSO);
|
||||
|
||||
OnRecipeSpawned?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -81,6 +84,8 @@ public class DeliveryManager : MonoBehaviour
|
|||
|
||||
waitingRecipeSOList.RemoveAt(i);
|
||||
|
||||
OnRecipeCompleted?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -92,4 +97,9 @@ public class DeliveryManager : MonoBehaviour
|
|||
Debug.Log("Player brought the wrong recipe!");
|
||||
}
|
||||
|
||||
public List<RecipeSO> GetWaitingRecipeSOList()
|
||||
{
|
||||
return waitingRecipeSOList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Reference in a new issue