Beispiel #1
0
 protected void OnItemComplete(SequenceItemCompleteEvent gameEvent)
 {
     if (pending.Remove(gameEvent.item) && (pending.Count == 0))
     {
         GlobalState.EventService.RemoveEventHandler <SequenceItemCompleteEvent>(OnItemComplete);
         blockadeService.Remove(this);
         Complete();
     }
 }
Beispiel #2
0
        private void OnWinTextAnimationComplete(SequenceItemCompleteEvent gameEvent)
        {
            if (gameEvent.item == currentItem)
            {
                eventService.RemoveEventHandler <SequenceItemCompleteEvent>(OnWinTextAnimationComplete);

                Destroy(currentItem);
                currentItem = null;

                StartCoroutine(RunActionAfterDelay(config.delayBeforeCelebration, () =>
                {
                    eventService.Dispatch(new StartWinAnimationsEvent());
                }));
            }
        }
        public void OnItemComplete(SequenceItemCompleteEvent gameEvent)
        {
            if (pending.Remove(gameEvent.item) && (pending.Count == 0))
            {
                GlobalState.EventService.RemoveEventHandler <SequenceItemCompleteEvent>(OnItemComplete);

                var parent = transform.parent;

                foreach (var sequence in startOnComplete)
                {
                    var instance = Instantiate(sequence);
                    instance.transform.SetParent(parent, false);
                }

                Destroy(gameObject);
            }
        }