Esempio n. 1
0
    void OnMatching(Matching match)
    {
        if (match != null)
        {
            foreach (var entity in match.blocks)
            {
                if (match.IsCharged())
                {
                    if (match.blockEntity.destroyVFX > 0)
                    {
                        AttachEffect(match.blockEntity.destroyVFX, entity.Offset, 1);
                    }
                }
                else
                {
                    if (match.blockEntity.destroyVFX > 0)
                    {
                        AttachEffect(match.blockEntity.destroyVFX, entity.Offset, 1);
                    }
                }
            }

            // sound
            if (match.IsCharged())
            {
                PlaySound(match.blockEntity.destroySFX);
            }
            else
            {
                int soundId = GetInARowSoundId(match.pattern.Count);
                PlaySound(soundId);
            }
        }
    }