Пример #1
0
    private void OnBubbleDestroyed(BubbleDestroyedEvent gameEvent)
    {
        var position = gameEvent.bubble.transform.position;

        counter++;
        xAverage = ((xAverage * (counter - 1)) + position.x) / counter;
        yMin     = (counter == 1) ? position.y : Mathf.Min(yMin, position.y);
        // Hack for VS
        yMin += 1f;
    }
Пример #2
0
    private void OnBubbleScore(BubbleScoreEvent gameEvent)
    {
        if (gameEvent.bubble == Model)
        {
            Score += gameEvent.score;

            if (!playedEffect)
            {
                playedEffect = true;

                var bubbleDestroyedEvent = new BubbleDestroyedEvent(Model.definition.Score, gameObject);
                GlobalState.EventService.Dispatch(bubbleDestroyedEvent);
            }
        }
    }
Пример #3
0
 private void OnBubbleDestroyed(BubbleDestroyedEvent gameEvent)
 {
     levelState.UpdateTypeTotals(gameEvent.bubble.GetComponent <BubbleModelBehaviour>().Model.type, -1);
 }