Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
 void Awake()
 {
     currentHp = baseHp;
     if (animator == null)
     {
         animator = GetComponent <Animator>();
     }
     if (_gameManager == null)
     {
         _gameManager = FindObjectOfType <GameManager>();
     }
     if (_soundManager == null)
     {
         _soundManager = FindObjectOfType <SoundManager>();
     }
     if (_cameraController == null)
     {
         _cameraController = FindObjectOfType <CameraController>();
     }
     if (_board == null)
     {
         _board = FindObjectOfType <Board>();
     }
     if (enemyAi == null)
     {
         enemyAi = FindObjectOfType <EnemyAi>();
     }
     if (enemyMove)
     {
         enemyMove = GetComponent <EnemyMove>();
     }
     if (moveBaseArea == null)
     {
         moveBaseArea = transform.Find("Utility").Find("MoveBaseArea").gameObject;
     }
     if (moveDoubleArea == null)
     {
         moveDoubleArea = transform.Find("Utility").Find("MoveDoubleArea").gameObject;
     }
     if (_model == null)
     {
         _model = transform.Find("Model");
     }
 }
Exemplo n.º 3
0
        void Awake()
        {
            if (line == null)
            {
                line = transform.Find("Line").GetComponent <LineRenderer>();
            }
            if (_pathFinding == null)
            {
                _pathFinding = GetComponent <PathFinding>();
            }
            if (_gameManager == null)
            {
                _gameManager = FindObjectOfType <GameManager>();
            }
            if (_enemyAi == null)
            {
                _enemyAi = _gameManager.GetComponent <EnemyAi>();
            }
            if (boundary == null)
            {
                boundary = transform.Find("Boundary");
            }
            if (boardBoundary == null)
            {
                boundary = transform.Find("BoardBoundary");
            }
            if (tileNode == null)
            {
                tileNode = transform.Find("TileNode");
            }

            MakeMap();

            if (_nodeList == null)
            {
                _nodeList = new List <TileNode>(FindObjectsOfType <TileNode>());
            }
        }