2025-07-15 04:48:01 +00:00
|
|
|
using System.Threading.Tasks;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace DDD
|
|
|
|
{
|
2025-07-21 04:11:38 +00:00
|
|
|
[CreateAssetMenu(fileName = "CreateEnvironmentSo", menuName = "GameFlow/CreateEnvironmentSo")]
|
|
|
|
public class CreateEnvironmentSo : GameFlowTask
|
2025-07-15 04:48:01 +00:00
|
|
|
{
|
|
|
|
public override async Task OnReadyNewFlow(GameFlowState newFlowState)
|
|
|
|
{
|
|
|
|
var baseRestaurantEnvironmentPrefab = await AssetManager.LoadAsset<GameObject>(CommonConstants.BaseRestaurantEnvironment);
|
|
|
|
|
2025-07-21 04:20:31 +00:00
|
|
|
var props = RestaurantController.Instance.RestaurantEnvironmentStateSo.RestaurantEnvironmentProps;
|
2025-07-17 06:20:30 +00:00
|
|
|
foreach (var prop in props)
|
2025-07-15 04:48:01 +00:00
|
|
|
{
|
2025-07-21 04:11:38 +00:00
|
|
|
var restaurantEnvironment = Instantiate(baseRestaurantEnvironmentPrefab).GetComponent<RestaurantEnvironment>();
|
2025-07-17 06:20:30 +00:00
|
|
|
restaurantEnvironment.Initialize(prop);
|
2025-07-15 04:48:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|