void Awake() { if (_mainCanvas == null) { _mainCanvas = FindObjectOfType <MainCanvas>(); } if (common == null) { common = GetComponent <Common>(); } if (round == null) { round = transform.Find("Round"); } if (_playerTransform == null) { _playerTransform = transform.Find("PlayerUnit"); } if (_enemyTransform == null) { _enemyTransform = transform.Find("EnemyUnit"); } if (close == null) { close = transform.Find("Close"); } if (_cameraController == null) { _cameraController = FindObjectOfType <CameraController>(); } if (_board == null) { _board = FindObjectOfType <Board>(); } _playerList = new List <Player>(FindObjectsOfType <Player>()); MakeActivePlayerList(_playerList, activePlayerList); _enemyList = new List <Enemy>(FindObjectsOfType <Enemy>()); if (enemyAi == null) { enemyAi = FindObjectOfType <EnemyAi>(); } MakeActiveEnemyList(_enemyList, activeEnemyList); _weaponList = new List <Weapon>(FindObjectsOfType <Weapon>()); if (effectManager == null) { effectManager = GetComponent <EffectManager>(); } if (areaCheck == null) { areaCheck = GetComponent <AreaCheck>(); } if (milestone == null) { milestone = transform.Find("Milestone").gameObject; } }
void Awake() { if (_board == null) { FindObjectOfType <Board>(); } if (_gameManager == null) { _gameManager = FindObjectOfType <GameManager>(); } _areaCheck = _gameManager.areaCheck; }