Megacity demo game for UOS
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

25 行
822 B

using Unity.Entities;
using UnityEngine;
using Unity.MegaCity.Gameplay;
namespace Unity.MegaCity.Authoring
{
/// <summary>
/// Create tag component for the player camera target
/// </summary>
public class PlayerSpawnerAuthoring : MonoBehaviour
{
public GameObject Player;
[BakingVersion("julian", 2)]
public class PlayerSpawnerBaker : Baker<PlayerSpawnerAuthoring>
{
public override void Bake(PlayerSpawnerAuthoring authoring)
{
var entity = GetEntity(authoring.gameObject, TransformUsageFlags.Dynamic);
var player = GetEntity(authoring.Player, TransformUsageFlags.Dynamic);
AddComponent(entity, new PlayerSpawner { Player = player });
}
}
}
}