/// <summary>
 /// Returns the moving light back to pool, so it can be used again
 /// </summary>
 /// <param name="parent"> parent of the light</param>
 public void BackToPool(KanteleHeroPanel parent)
 {
     _speed  = 0;
     _parent = null;
     _currentWaypointIndex = 0;
     Waypoints             = null;
     _startPos             = transform.position;
     startTime             = 0;
     _waypointSpeed        = 0;
     parent.ReturnLightToPool(this);
 }
 /// <summary>
 /// Initializes the moving light on the panel
 /// </summary>
 /// <param name="waypoints"> Waypoints that the light moves along</param>
 /// <param name="parent"> the panel that initializes the light</param>
 public void Init(GameObject[] waypoints, KanteleHeroPanel parent, float speed, LightSide side, int noteNumber)
 {
     _speed  = speed;
     _parent = parent;
     _currentWaypointIndex = 1;
     _noteNumber           = noteNumber;
     Waypoints             = waypoints;
     transform.position    = waypoints[0].transform.position;
     _startPos             = transform.position;
     startTime             = 0;
     _side          = side;
     _waypointSpeed = Vector3.Distance(transform.position, Waypoints[_currentWaypointIndex].transform.position);
 }
        private void Start()
        {
            _eventSystem   = FindObjectOfType <EventSystem>();
            _stateManager  = FindObjectOfType <StateManager>();
            _confirmation  = GetComponentInChildren <ConfirmationDialog>();
            _highscoreList = GameManager.Instance.HighscoreList;
            _cursor        = FindObjectOfType <MouseCursorController>();
            _heatMap       = FindObjectOfType <HeatMap>();
            _kantelePanel  = FindObjectOfType <KanteleHeroPanel>();
            _collSpawner   = FindObjectOfType <CollectableSpawner>();

            // Allows the cursor to select the current menu's
            // default selected button when it is hidden
            _cursor.SelectMenuButtonAction = SelectDefaultSelectedMenuButton;

            // Hides the scoreboard by default
            _highscoreList.Visible = false;

            // Registers to listen to the GameOver event.
            // When the GameOver event is triggered, the first
            // button in the game over menu is highlighted
            _stateManager.GameOver += HighlightGameOverMenuButton;

            //// Registers to listen to the PauseMenuActivated event.
            //// Makes the scoreboard visible and doesn't allow
            //// hiding it in the pause menu
            //_stateManager.PauseMenuActivated += PauseMenuEntered;

            //// Registers to listen to the PauseMenuDeactivated event.
            //// Changes the scoreboard's visibility to what it
            //// was before accessing the pause menu
            //_stateManager.PauseMenuDeactivated += PauseMenuExited;

            // Registers to listen to the ScreenStateChanged event.
            _stateManager.ScreenStateChanged += OnScreenStateChanged;
            OnScreenStateChanged(ScreenStateType.MainMenu);

            L10n.LanguageLoaded += OnLanguageLoaded;
            OnLanguageLoaded();

#if UNITY_EDITOR
            _debugEnabled = true;
#else
            _debugEnabled = false;
#endif
        }
 public void Init(KanteleHeroPanel parent)
 {
     _parent = parent;
 }