30 lines
952 B
C#
30 lines
952 B
C#
using System.Threading.Tasks;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
public class CreateRestaurantPlayer : RestaurantFlowTask
|
|
{
|
|
[SerializeField]
|
|
private Vector3 _spawnPosition;
|
|
|
|
public override async Task ReadyFlowTask()
|
|
{
|
|
|
|
}
|
|
|
|
public override async Task RunFlowTask()
|
|
{
|
|
// TODO : Player exist check
|
|
|
|
var playerPrefab = await AssetManager.LoadAsset<GameObject>(CommonConstants.RestaurantPlayer);
|
|
var player = PrefabUtility.InstantiatePrefab(playerPrefab) as GameObject;
|
|
player.transform.position = _spawnPosition;
|
|
player.transform.rotation = playerPrefab.transform.rotation;
|
|
player.name = CommonConstants.RestaurantPlayer;
|
|
CameraManager.Instance.GetCameraGameObject(CameraType.RestaurantBaseCamera)
|
|
.SetFollowAndLookAtTarget(player.transform);
|
|
}
|
|
}
|
|
} |