// Set references
    private void Awake()
    {
        // Validation on Serialize Fields
        //if (allyTempParent == null)
        //Debug.Log("allyTempParent was not initialized correctly in ProceduralGenerationContoller attached to " + this.name);

        // Validation on other Procedural Gen Scripts
        GameObject procGenContObj = this.gameObject;

        _genRoomsRef = procGenContObj.GetComponent <GenerateRooms>();
        if (_genRoomsRef == null)
        {
            Debug.Log("There was no GenerateRooms attached to " + procGenContObj.name);
        }
        _wallsGenRef = procGenContObj.GetComponent <GenerateWalls>();
        if (_wallsGenRef == null)
        {
            Debug.Log("There was no GenerateWalls attached to " + procGenContObj.name);
        }
        _stairsGenRef = procGenContObj.GetComponent <GenerateStairs>();
        if (_stairsGenRef == null)
        {
            Debug.Log("There was no GenerateStairs attached to " + procGenContObj.name);
        }
        _tilesGenRef = procGenContObj.GetComponent <GenerateTiles>();
        if (_tilesGenRef == null)
        {
            Debug.Log("There was no GenerateTiles attached to " + procGenContObj.name);
        }
        _safeRoomGenRef = procGenContObj.GetComponent <GenerateSafeRoom>();
        if (_safeRoomGenRef == null)
        {
            Debug.Log("There was no GenerateSafeRoom attached to " + procGenContObj.name);
        }
        _placeAlliesRef = procGenContObj.GetComponent <PlaceAllies>();
        if (_placeAlliesRef == null)
        {
            Debug.Log("There was no PlaceAllies attached to " + procGenContObj.name);
        }
        _enemiesGenRef = procGenContObj.GetComponent <GenerateEnemies>();
        if (_enemiesGenRef == null)
        {
            Debug.Log("There was no GenerateEnemies attached to " + procGenContObj.name);
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        uim     = GameObject.FindGameObjectWithTag("BoardUI").GetComponent <UIManager>();
        allTeam = GameObject.FindGameObjectWithTag("Team").GetComponent <Team>();
        gm      = FindObjectOfType <GameManager>();

        gt = GetComponent <GenerateTiles>();

        teams  = TeamInformationHandler.GetComponent <TeamHandler>();
        em     = TeamInformationHandler.GetComponent <EnemyManager>();
        traits = TeamInformationHandler.GetComponent <TraitBonuses>();

        GameObject StoredTiles = new GameObject("StoredTiles");

        map = new Grid(x, y, cellSize, tile, StoredTiles); // creates grid

        gt.SpawnTiles(x, y, cellSize);

        playerTurn = 1;
        allTeam.LoadArtifacts();
    }
Exemplo n.º 3
0
    /// <summary>
    /// Starts the generation of the floor
    /// </summary>
    public void StartGeneration()
    {
        //Debug.Log("StartGeneration");
        // Get the procedural generation controller
        GameObject genCont = GameObject.FindWithTag("GenerationController");

        if (genCont == null)
        {
            Debug.LogError("Could not find a gameobject with the tag GenerationController");
        }

        // Get the procedural generation script attached to it
        ProceduralGenerationController genContScript = genCont.GetComponent <ProceduralGenerationController>();

        if (genContScript == null)
        {
            Debug.LogError("Could not a ProceduralGenerationController script attached to " + genCont.name);
        }

        // Set the active tileset
        GenerateTiles genTilesRef = genContScript.GetComponent <GenerateTiles>();

        if (genTilesRef == null)
        {
            Debug.LogError("Could not a GenerateTiles script attached to " + genCont.name);
        }
        // See if we should swap the tileset
        CheckSwapTileset();
        genTilesRef.SetActiveTileSet(_activeTileSet);

        // Set the difficulty of the floor
        genContScript.CurrentFloorDifficulty = _nextFloorDiff;

        // Start the generation
        genContScript.GenerateFloor(_shouldHaveCamfire, _nextFloorRoomAm, _tempAllyParent);
    }
Exemplo n.º 4
0
 public void Awake()
 {
     instance = this;
 }