protected WidgetBallCount InstantiateWidget(Ball.Color color) { WidgetBallCount widget = Instantiate(Template, transform); widget.InitWithColor(color); return(widget); }
protected bool AddWidget(WidgetBallCount widget) { if (widget) { mWidgetsCounter.Add(widget); } return(true); }
public Vector3 GetWidgetPosition(Ball.Color color) { WidgetBallCount widget = mWidgetsCounter.FirstOrDefault(w => w.BallColor == color); if (widget) { return(widget.HitPointPosition); } return(Vector3.zero); }
public void OnEvent(GameScoreEvent gameScoreEvent) { switch (gameScoreEvent.Action) { case GamePlay.GameScore.Add: WidgetBallCount widget = mWidgetsCounter.FirstOrDefault(w => w.BallColor == gameScoreEvent.BallColor); if (widget) { widget.Score++; widget.SetTextScore(widget.Score); } break; } }