Beispiel #1
0
 /*public static LTDescr AddOnComplete(this LTDescr animation, Action action)
  * {
  *  EventSystem.Singleton.RegisterListener((GameEvent gameEvent)=> action(), new GameEvent() { eventType = GameEvent.EventEnum.AnimationCompleted, id = animation.guid.ToString() });
  *  return animation.setOnComplete(() =>
  *  {
  *      EventSystem.Singleton.PublishEvent(new GameEvent() { eventType = GameEvent.EventEnum.AnimationCompleted, id = animation.guid.ToString() });
  *  });
  * }
  * public static LTDescr AddOnStart(this LTDescr animation, Action action)
  * {
  *  EventSystem.Singleton.RegisterListener((GameEvent gameEvent) => action(), new GameEvent() { eventType = GameEvent.EventEnum.AnimationStarted, id = animation.guid.ToString() });
  *  return animation.setOnComplete(() =>
  *  {
  *      EventSystem.Singleton.PublishEvent(new GameEvent() { eventType = GameEvent.EventEnum.AnimationStarted, id = animation.guid.ToString() });
  *  });
  * }*/
 public static LTDescr SetCallEventOnComplete(this LTDescr animation, GameEvent gameEvent, bool allowDuplicates = true)
 {
     return(animation.addOnComplete(() =>
     {
         EventSystem.Singleton.PublishEvent(gameEvent, allowDuplicates);
     }));
 }