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);
        }
    }
示例#2
0
 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");
     }
 }
示例#3
0
    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");
        }
    }
示例#4
0
 void Start()
 {
     _levelInitializer = Camera.main.GetComponent<LevelInitializer>();
     InvokeRepeating("Spawner", 0f, 0.1f);
 }
示例#5
0
    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);
    }