21 lines
830 B
C#
21 lines
830 B
C#
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
[CreateAssetMenu(fileName = "CreateEnvironmentSo", menuName = "GameFlow/CreateEnvironmentSo")]
|
|
public class CreateEnvironmentSo : GameFlowTask
|
|
{
|
|
public override async Task OnReadyNewFlow(GameFlowState newFlowState)
|
|
{
|
|
var baseRestaurantEnvironmentPrefab = await AssetManager.LoadAsset<GameObject>(CommonConstants.BaseRestaurantEnvironment);
|
|
|
|
var props = RestaurantController.Instance.RestaurantEnvironmentStateSo.RestaurantEnvironmentProps;
|
|
foreach (var prop in props)
|
|
{
|
|
var restaurantEnvironment = Instantiate(baseRestaurantEnvironmentPrefab).GetComponent<RestaurantEnvironment>();
|
|
restaurantEnvironment.Initialize(prop);
|
|
}
|
|
}
|
|
}
|
|
} |