// Use this for initialization void Start() { if (soundEffects == null) { soundEffects = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <SoundEffectsManager>(); } #if UNITY_STANDALONE m_InGamePauseCanvas = GameObject.FindGameObjectWithTag(m_canvasTagname); #endif #if UNITY_ANDROID // Since there will only be 1 joystick! thePlayerJoystick = FindObjectOfType <PlayerDrag>(); #endif arrowTransform = GetComponent <RectTransform>(); GameObject[] allTheInGamePauseButtons = GameObject.FindGameObjectsWithTag(m_buttonTags); foreach (GameObject zeGO in allTheInGamePauseButtons) { //Debug.Log("Pause button name: " + zeGO.name); PauseButtonScript zePause = zeGO.GetComponent <PauseButtonScript>(); if (zePause != null) { allThePauseButtons.Add(zePause.m_Number, zePause); } } }
private void Start() { _pool = new Pool(_pointPrefab, _dotsParent); _clickController = new ClickController(); _routeView = new RouteView(_pool, _dotsParent); _route = new Route(_routeView); _pauseButtonScript = new PauseButtonScript(_pauseButton); _uIController = new UIController(_movingObject); _movingObject.Init(_route); _clickController.onMouseClickAction += _route.SetNewWayPoint; _pauseButtonScript.onPauseButtonClickAction += _uIController.OnPauseButtonClick; }