public void Init() { bubbleSettings = ResourceManager.GetResource <BubblesSettings>(GameConstants.BUBBLE_SETTINGS); currentBubble.Init(Random.Range(1, bubbleSettings.Bubbles.Count - 1)); nextBubble.Init(Random.Range(1, bubbleSettings.Bubbles.Count - 1)); nextBubble.Button.onClick.AddListener(OnSwapButtonClick); sessionController = SessionController.Instance; sessionController.BubblesController.CurrentPower = CurrentBubble.Power; sessionController.PlayerController.BubbleShootController.OnShootEnded += OnEndShoot; sessionController.PlayerController.BubbleShootController.OnShootStarted += OnStartShoot; }
public override void Init() { base.Init(); var sessionController = SessionController.Instance; var bubblesController = sessionController.BubblesController; bubblesController.OnBubbleAdded += OnBubblesAdded; bubblesController.OnBubbleReleased += OnBubbleReleased; bubblesController.OnBubblesCleared += perfectNotification.Show; bubblesSettings = ResourceManager.GetResource <BubblesSettings>(GameConstants.BUBBLE_SETTINGS); for (int i = 0; i < bubblesController.Bubbles.Count; i++) { var bubble = bubblesController.Bubbles[i]; OnBubblesAdded(bubble); } scoreController = sessionController.ScoreController; scoreController.OnScoreChanged += OnScoreChanged; OnScoreChanged(scoreController.Score); projectileSelectionGroup.Init(); }