Ejemplo n.º 1
0
        override protected void Complete()
        {
            if (gameObject.GetComponent <BubbleScore>().Score > 0)
            {
                effectController.AddEffect(AnimationEffect.Play(gameObject, AnimationType.ScoreText));
            }

            Object.Destroy(gameObject, 0.5f);
        }
Ejemplo n.º 2
0
 private void UpdateStarImages()
 {
     for (var index = currentStar; index < starCount; index++)
     {
         if (lastScore >= scores[index])
         {
             currentStar = index + 1;
             StartCoroutine(AnimationEffect.Play(stars[index], AnimationType.ActivateStarBarStar));
         }
     }
 }
Ejemplo n.º 3
0
        public void AddEffect(GameObject parent, AnimationType type, BubbleDeathType deathType, bool blocking)
        {
            if (!EffectDictionary.ContainsKey(deathType))
            {
                EffectDictionary.Add(deathType, new List <IEnumerator>());
            }

            var effect = blocking ? AnimationEffect.PlayAndRegister(parent, type, RegisterBlockers) :
                         AnimationEffect.Play(parent, type);

            EffectDictionary[deathType].Add(effect);
        }
Ejemplo n.º 4
0
        private void OnAnimateStarsOnMapNodeEvent(AnimateStarsOnMapNodeEvent gameEvent)
        {
            GlobalState.EventService.RemoveEventHandler <AnimateStarsOnMapNodeEvent>(OnAnimateStarsOnMapNodeEvent);

            for (long starIndex = gameEvent.oldStars; starIndex < filledStars; ++starIndex)
            {
                // We need to make a copy of starIndex so our lambda doesn't reference it directly
                var index        = starIndex;
                var newStarIndex = (index - gameEvent.oldStars);
                var delay        = (0.4f * (newStarIndex + 1));

                starPositions[index].enabled = false;

                Util.FrameUtil.AfterDelay(delay, () =>
                {
                    PlaySoundEvent.Dispatch(starSounds[newStarIndex]);
                    StartCoroutine(AnimationEffect.Play(starPositions[index].gameObject,
                                                        AnimationType.StarOnMapNode));
                });
            }
        }