Exemplo n.º 1
0
 private void OnTransition(StateMachine<StoryUpdateFunction, string>.Transition transition)
 {
     const string tag = "StoryState";
     var entity = World.TagManager.GetEntity(tag);
     if (entity != null)
     {
         entity.Tag = null;
         entity.Delete();
     }
     var component = new CoroutineComponent(transition.Destination(this, World), () => entity.Delete());
     entity = World.CreateEntity();
     entity.AddComponent(component);
     entity.Refresh();
     entity.Tag = tag;
 }