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

38 行
1012 B

using Unity.Entities;
[DisableAutoCreation]
public class TeleporterSystemClient : ComponentSystem
{
public struct Teleporters
{
public ComponentArray<TeleporterPresentation> teleporterPresentations;
public ComponentArray<TeleporterClient> teleporterClients;
}
[Inject]
Teleporters teleporters;
public TeleporterSystemClient(GameWorld gameWorld)
{
m_GameWorld = gameWorld;
}
protected override void OnUpdate()
{
for(int i = 0, c = teleporters.teleporterClients.Length; i < c; i++)
{
var teleporterPresentation = teleporters.teleporterPresentations[i];
var teleporterClient = teleporters.teleporterClients[i];
if (teleporterClient.effectEvent.Update(m_GameWorld.worldTime, teleporterPresentation.effectTick))
{
if(teleporterClient.effect != null)
SpatialEffectRequest.Create(PostUpdateCommands, teleporterClient.effect,
teleporterClient.effectTransform.position, teleporterClient.effectTransform.rotation);
}
}
}
GameWorld m_GameWorld;
}