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