Exemplo n.º 1
0
        void OnCharacterPassThoughLayer(PedestalLayer layer)
        {
            if (!HasPowerUp() && !layer.hasDestroyed)
            {
                _floorCombo += 1;
            }

            var eventPlayerPassLayer = new EventCharacterPassLayer(layer);

            eventPlayerPassLayer.hasCombo          = HasCombo();
            eventPlayerPassLayer.hasPowerup        = HasPowerUp();
            eventPlayerPassLayer.hasLayerDestroyed = layer.hasDestroyed;
            EventHub.Emit(eventPlayerPassLayer);

            // Special case, character has powerup and pass through the layer
            if (!layer.hasDestroyed && HasPowerUp())
            {
                UsePowerUp(null);
            }

            if (!layer.hasDestroyed)
            {
                _platform.DestroyLayer(layer, HasPowerUp());
            }

            _scoreCaculator.OnPassingLayer(HasPowerUp(), layer);
        }
Exemplo n.º 2
0
        private void ShowFishesEscapeEffect(EventCharacterPassLayer e)
        {
            if (e.hasPowerup || e.hasLayerDestroyed)
            {
                return;
            }

            PedestalType layerType = PedestalType.None;

            foreach (var item in e.layer.pedestalInfos)
            {
                if (item.type == PedestalType.Pedestal_01 ||
                    item.type == PedestalType.Pedestal_01_1_Fish ||
                    item.type == PedestalType.Pedestal_01_3_Fish)
                {
                    layerType = item.type;
                    break;
                }
            }

            if (layerType == PedestalType.Pedestal_01 || layerType == PedestalType.Pedestal_01_1_Fish || layerType == PedestalType.Pedestal_01_3_Fish)
            {
                Vector3 effectPosition = new Vector3(0f, e.layer.height + 0.3f, _mainCharacter.transform.position.z - 1);
                var     effect         = _effectPool.Instantiate(layerType, effectPosition, 0);
                effect.transform.SetParent(_camera, true);
            }
        }