Ejemplo n.º 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;
    }
Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 3
0
 private void OnBubbleDestroyed(BubbleDestroyedEvent gameEvent)
 {
     levelState.UpdateTypeTotals(gameEvent.bubble.GetComponent <BubbleModelBehaviour>().Model.type, -1);
 }