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

            Object.Destroy(gameObject, 0.5f);
        }
예제 #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));
         }
     }
 }
예제 #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);
        }
예제 #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));
                });
            }
        }