protected override void Initialize(GameObject go, object item, UnityEvent onClick) { LevelInitializer levelInitializer = go.GetComponent <LevelInitializer>(); Level level = item as Level; if (level != null) { levelInitializer.Init(level, onClick); } }
public void Initialize() { savingSystem = GetComponent <SavingSystem>(); levelInitializer = GetComponent <LevelInitializer>(); initializer = FindObjectOfType <EditorInitializer>(); gameManager = FindObjectOfType <GameManager>(); player = FindObjectOfType <PlayerManager>(); board = FindObjectOfType <Board>(); if (initializer == null) { Debug.LogWarning("Editor initializer is lost"); } }
public void Initialize() { obstaclePlacement = GetComponent <ObstaclePlacement>(); if (obstaclePlacement == null) { Debug.LogWarning("Obstacle placement is lost!"); } objectPlacement = GetComponent <ObjectPlacement>(); if (objectPlacement == null) { Debug.LogWarning("Object placement is lost"); } enemyPlacement = GetComponent <EnemyPlacement>(); if (enemyPlacement == null) { Debug.LogWarning("Enemy placement is lost!"); } board = FindObjectOfType <Board>(); if (board == null) { Debug.LogWarning("Board is lost"); } levelInitializer = GetComponent <LevelInitializer>(); if (levelInitializer == null) { Debug.Log("Level initializer is lost"); } buildingPlacement = GetComponent <BuildingPlacement>(); if (buildingPlacement == null) { Debug.Log("Building placement is lost"); } }
void Start() { _levelInitializer = Camera.main.GetComponent<LevelInitializer>(); InvokeRepeating("Spawner", 0f, 0.1f); }
void Start() { _eventEnemyListener += DealDamage; _player = GameObject.FindWithTag("Player").transform; _agent = GetComponent<NavMeshAgent>(); _rigidbody = GetComponent<Rigidbody>(); _levelInitializer = Camera.main.GetComponent<LevelInitializer>(); _uI = Camera.main.GetComponent<UI>(); transform.LookAt(_player); }