ProjectDDD/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantEnvironmentController.cs

46 lines
1.5 KiB
C#
Raw Normal View History

using System.Threading.Tasks;
using UnityEngine;
namespace DDD
{
public class RestaurantEnvironmentController : RestaurantFlowController
{
private RestaurantEnvironmentStateSo _environmentState;
public override async Task InitializeController()
{
}
public override async Task InitializeState()
{
_environmentState = RestaurantState.instance.EnvironmentState;
}
public override async Task OnReadyNewFlow(GameFlowState newFlowState)
{
// if(newFlowState == GameFlowState.ReadyForRestaurant) GenerateDummyEnvironmentProps(); // XXX : DUMMY! REMOVE THIS
}
public override async Task OnExitCurrentFlow(GameFlowState exitingFlowState)
{
}
private void GenerateDummyEnvironmentProps()
{
// Make dummy placement data
foreach (EnvironmentData prop in DataManager.Instance.GetDataSo<EnvironmentDataSo>().GetDataList())
{
for (int i = 0; i < 10; i++)
{
// Make a random position
Vector2 randomPos = new Vector2(
Random.Range(-10f, 10f),
Random.Range(10f, 20f)
);
var randomPropData = new RestaurantPropLocation(prop.Id, randomPos);
_environmentState.Props.Add(randomPropData);
}
}
}
}
}